qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH v2] migration: allow setting MIG_STATE_CANCEL even i


From: Yoshiaki Tamura
Subject: [Qemu-devel] [PATCH v2] migration: allow setting MIG_STATE_CANCEL even if s->state != MIG_STATE_ACTIVE.
Date: Tue, 1 Mar 2011 16:08:09 +0900

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

Migration status: failed

This patch checks s->state == MIG_STATE_CANCEL instead of s->state !=
MIG_STATE_ACTIVE.  With this patch the message above would be:

Migration status: cancelled

Please note that the following patches are prerequisite.

http://www.mail-archive.com/address@hidden/msg56448.html
http://www.mail-archive.com/address@hidden/msg56446.html

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

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




reply via email to

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