]> git.proxmox.com Git - mirror_qemu.git/commitdiff
migration: Fix global state with Xen.
authorAnthony PERARD <anthony.perard@citrix.com>
Mon, 3 Aug 2015 14:29:19 +0000 (15:29 +0100)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Mon, 3 Aug 2015 16:13:23 +0000 (16:13 +0000)
When doing migration via the QMP command xen_save_devices_state, the
current runstate is not store into the global state section. Also the
current runstate is not the one we want on the receiver side.

During migration, the Xen toolstack paused QEMU before save the devices
state. Also, the toolstack expect QEMU to autostart when the migration is
finished.
So this patch store "running" as it's current runstate.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
include/migration/migration.h
migration/migration.c
migration/savevm.c

index a2f8ed093c248f62f561afd58a74943fc9f33f53..83346210b11172efbbd2f1853214327edd325a23 100644 (file)
@@ -203,4 +203,5 @@ void register_global_state(void);
 void global_state_set_optional(void);
 void savevm_skip_configuration(void);
 int global_state_store(void);
+void global_state_store_running(void);
 #endif
index fd4f99b84e3b2c7b5eca22d7801122d9980c8966..662e77e4eb8390ff304ae49db5bc12d61c672c75 100644 (file)
@@ -122,6 +122,13 @@ int global_state_store(void)
     return 0;
 }
 
+void global_state_store_running(void)
+{
+    const char *state = RunState_lookup[RUN_STATE_RUNNING];
+    strncpy((char *)global_state.runstate,
+           state, sizeof(global_state.runstate));
+}
+
 static bool global_state_received(void)
 {
     return global_state.received;
index 81dbe5879fa8aad7ccbc646421babd4e9dc4a45a..60712153fafda9cf3be7c3cd69fb8387721d6474 100644 (file)
@@ -1394,6 +1394,7 @@ void qmp_xen_save_devices_state(const char *filename, Error **errp)
 
     saved_vm_running = runstate_is_running();
     vm_stop(RUN_STATE_SAVE_VM);
+    global_state_store_running();
 
     f = qemu_fopen(filename, "wb");
     if (!f) {