summaryrefslogtreecommitdiff
path: root/migration
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2015-07-15 09:53:46 +0200
committerJuan Quintela <quintela@redhat.com>2015-07-15 12:22:54 +0200
commit560d027b54067ffa4e79c6f7c0a499abb0d749a3 (patch)
treeaa575a5d07c70c0674498a69e606e5307f121d7f /migration
parent9f5f380b54d6ad80cf35d93c8cd71c8d7a1b52b7 (diff)
downloadqemu-560d027b54067ffa4e79c6f7c0a499abb0d749a3.zip
migration: We also want to store the global state for savevm
Commit df4b1024526cae3479da3492d6371fd4a7324a03 introduced global_state section. But it only filled the state while doing migration. While doing a savevm, we stored an empty string as state. So when we did a loadvm, it complained that state was invalid. Fedora 21, 4.1.1, qemu 2.4.0-rc0 > ../../configure --target-list="x86_64-softmmu" 068 2s ... - output mismatch (see 068.out.bad) --- /home/bos/jhuston/src/qemu/tests/qemu-iotests/068.out 2015-07-08 17:56:18.588164979 -0400 +++ 068.out.bad 2015-07-09 17:39:58.636651317 -0400 @@ -6,6 +6,8 @@ QEMU X.Y.Z monitor - type 'help' for more information (qemu) savevm 0 (qemu) quit +qemu-system-x86_64: Unknown savevm section or instance 'globalstate' 0 +qemu-system-x86_64: Error -22 while loading VM state QEMU X.Y.Z monitor - type 'help' for more information (qemu) quit *** done Failures: 068 Failed 1 of 1 tests Actually, there were two problems here: - we registered global_state too late for load_vm (fixed on another patch on the list) - we didn't store a valid state for savevm (fixed by this patch). Reported-by: John Snow <jsnow@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Amit Shah <amit.shah@redhat.com> Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'migration')
-rw-r--r--migration/migration.c2
-rw-r--r--migration/savevm.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/migration/migration.c b/migration/migration.c
index ba82ff6bd1..86ca099ac4 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -110,7 +110,7 @@ typedef struct {
static GlobalState global_state;
-static int global_state_store(void)
+int global_state_store(void)
{
if (!runstate_store((char *)global_state.runstate,
sizeof(global_state.runstate))) {
diff --git a/migration/savevm.c b/migration/savevm.c
index 86735fc53a..81dbe5879f 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -1315,6 +1315,12 @@ void hmp_savevm(Monitor *mon, const QDict *qdict)
}
saved_vm_running = runstate_is_running();
+
+ ret = global_state_store();
+ if (ret) {
+ monitor_printf(mon, "Error saving global state\n");
+ return;
+ }
vm_stop(RUN_STATE_SAVE_VM);
memset(sn, 0, sizeof(*sn));