Blob Blame History Raw
From 20a48b7b71a2aa56797026c4ffaac6fed113d897 Mon Sep 17 00:00:00 2001
From: Laurent Vivier <lvivier@redhat.com>
Date: Tue, 25 Jul 2017 14:32:33 +0200
Subject: [PATCH 06/17] spapr/htab: fix savevm

RH-Author: Laurent Vivier <lvivier@redhat.com>
Message-id: <20170725143233.6306-1-lvivier@redhat.com>
Patchwork-id: 75837
O-Subject: [RHEL-ALT-7.4 qemu-kvm PATCH] spapr/htab: fix savevm
Bugzilla: 1470035
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
RH-Acked-by: David Gibson <dgibson@redhat.com>

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>
(cherry picked from commit e8cd4247e96bb2158ef0ae0ff20e72746b9dd32d)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>

BREW: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=13717506
BZ:   https://bugzilla.redhat.com/show_bug.cgi?id=1470035
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
 hw/ppc/spapr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 07c28d4..0c401bf 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1748,7 +1748,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);
     }
-- 
1.8.3.1