qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH] migration: allow setting MIG_STATE_CANCEL even if s


From: Yoshiaki Tamura
Subject: [Qemu-devel] [PATCH] migration: allow setting MIG_STATE_CANCEL even if s->state != MIG_STATE_ACTIVE.
Date: Thu, 24 Feb 2011 18:53:50 +0900

After migration failure, even a user commands migrate_cancel, it keeps
saying:

Migration status: failed

Move checking s->state is MIG_STATE_ACTIVE, to allow setting
MIG_STATE_CANCEL even if s->state != MIG_STATE_ACTIVE.  With this
patch the message above would be:

Migration status: cancelled

Signed-off-by: Yoshiaki Tamura <address@hidden>
---
 migration.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/migration.c b/migration.c
index af3a1f2..098885f 100644
--- a/migration.c
+++ b/migration.c
@@ -409,15 +409,16 @@ void migrate_fd_cancel(MigrationState *mig_state)
 {
     FdMigrationState *s = migrate_to_fms(mig_state);
 
-    if (s->state != MIG_STATE_ACTIVE)
-        return;
-
     DPRINTF("cancelling migration\n");
 
     s->state = MIG_STATE_CANCELLED;
     notifier_list_notify(&migration_state_notifiers);
-    qemu_savevm_state_cancel(s->mon, s->file);
 
+    if (s->state != MIG_STATE_ACTIVE) {
+        return;
+    }
+
+    qemu_savevm_state_cancel(s->mon, s->file);
     migrate_fd_cleanup(s);
 }
 
-- 
1.7.1.2




reply via email to

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