spapr/htab: fix savevm
authorLaurent Vivier <lvivier@redhat.com>
Tue, 18 Jul 2017 10:16:32 +0000 (12:16 +0200)
committerDavid Gibson <david@gibson.dropbear.id.au>
Tue, 25 Jul 2017 01:14:25 +0000 (11:14 +1000)
Commit 3a38429 ("spapr: Add a "no HPT" encoding to HTAB migration stream")
allows to migrate an empty HPT, but doesn't mark correctly the
end of the migration stream.

The end condition (value returned by htab_save_iterate())
should be 1, whereas in 3a38429 it returns 0.

The problem can be reproduced with QEMU monitor command "savevm":
the command never stops and the disk image grows without limit.

Fixes: 3a38429748aa4f74abaecf16c4c087e8a325e12a
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr.c

index 970093e6b593b6d9b974de9cffcee04e7ac4dfa7..1cb09e7c64829b35f6b15713b9e4645905de6bd1 100644 (file)
@@ -1827,7 +1827,7 @@ static int htab_save_iterate(QEMUFile *f, void *opaque)
     /* Iteration header */
     if (!spapr->htab_shift) {
         qemu_put_be32(f, -1);
-        return 0;
+        return 1;
     } else {
         qemu_put_be32(f, 0);
     }