diff mbox

[v2,2/2] migration: go to paused state after finishing incoming migration with -S

Message ID 1350657924-10624-3-git-send-email-pbonzini@redhat.com
State New
Headers show

Commit Message

Paolo Bonzini Oct. 19, 2012, 2:45 p.m. UTC
At the end of migration the machine has started already, and cannot be
destroyed without losing the guest's data.  Hence, prelaunch is the
wrong state.  Go to the paused state instead.  QEMU would reach that
state anyway (after running the guest for the blink of an eye) if the
"stop" command had been received after the start of migration.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 migration.c | 2 +-
 vl.c        | 2 +-
 2 file modificati, 2 inserzioni(+), 2 rimozioni(-)
diff mbox

Patch

diff --git a/migration.c b/migration.c
index 32d43e7..72abd3c 100644
--- a/migration.c
+++ b/migration.c
@@ -108,7 +108,7 @@  static void process_incoming_migration_co(void *opaque)
     if (autostart) {
         vm_start();
     } else {
-        runstate_set(RUN_STATE_PRELAUNCH);
+        runstate_set(RUN_STATE_PAUSED);
     }
 }
 
diff --git a/vl.c b/vl.c
index 5b357a3..8b1e0b2 100644
--- a/vl.c
+++ b/vl.c
@@ -341,7 +341,7 @@  static const RunStateTransition runstate_transitions_def[] = {
     { RUN_STATE_DEBUG, RUN_STATE_RUNNING },
 
     { RUN_STATE_INMIGRATE, RUN_STATE_RUNNING },
-    { RUN_STATE_INMIGRATE, RUN_STATE_PRELAUNCH },
+    { RUN_STATE_INMIGRATE, RUN_STATE_PAUSED },
 
     { RUN_STATE_INTERNAL_ERROR, RUN_STATE_PAUSED },
     { RUN_STATE_INTERNAL_ERROR, RUN_STATE_FINISH_MIGRATE },