qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-ppc] Problem with "savevm" on ppc64


From: Thomas Huth
Subject: [Qemu-ppc] Problem with "savevm" on ppc64
Date: Thu, 20 Oct 2016 15:17:12 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0

 Hi all,

I'm currently facing a strange problem with the "savevm" HMP command on
ppc64 with TCG and the pseries machine. Steps for reproduction:

1) Create a disk image:
   qemu-img create -f qcow2  /tmp/test.qcow2 1M

2) Start QEMU (in TCG mode):
   qemu-system-ppc64 -nographic -vga none -m 256 -hda /tmp/test.qcow2

3) Hit "CTRL-a c" to enter the HMP monitor

4) Type "savevm test1" to save a snapshot

The savevm command then hangs forever and the test.qcow2 image keeps
growing and growing.

It seems like qemu_savevm_state_iterate() does not make any more
progress because ram_save_iterate() keeps returning 0 ... but why can
that happen?

I've tinkered with the code a little bit, and I can get it to work with
the following patch - which however is quite independent of the
ram_save_iterate() code:

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index ddb7438..a7ac0bf 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1290,7 +1290,7 @@ static int htab_save_setup(QEMUFile *f, void *opaque)
     return 0;
 }

-static void htab_save_first_pass(QEMUFile *f, sPAPRMachineState *spapr,
+static int htab_save_first_pass(QEMUFile *f, sPAPRMachineState *spapr,
                                  int64_t max_ns)
 {
     bool has_timeout = max_ns != -1;
@@ -1340,6 +1340,8 @@ static void htab_save_first_pass(QEMUFile *f,
sPAPRMachineState *spapr,
         spapr->htab_first_pass = false;
     }
     spapr->htab_save_index = index;
+
+    return !spapr->htab_first_pass;
 }

 static int htab_save_later_pass(QEMUFile *f, sPAPRMachineState *spapr,
@@ -1444,7 +1446,7 @@ static int htab_save_iterate(QEMUFile *f, void
*opaque)
             return rc;
         }
     } else  if (spapr->htab_first_pass) {
-        htab_save_first_pass(f, spapr, MAX_ITERATION_NS);
+        rc = htab_save_first_pass(f, spapr, MAX_ITERATION_NS);
     } else {
         rc = htab_save_later_pass(f, spapr, MAX_ITERATION_NS);
     }

That means, if htab_save_iterate() does not initially return a 0, then
ram_save_iterate() also does not run into the condition of returning
zeroes later. But how are these related? And is it safe for returning a
non-zero value in htab_save_first_pass()? Does anybody with more
experience in this area has a clue what's going on here?

 Thanks for any help,
  Thomas



reply via email to

[Prev in Thread] Current Thread [Next in Thread]