Patchwork [08/28] migration: Check that migration is active before cancel it

login
register
mail settings
Submitter Juan Quintela
Date Feb. 23, 2011, 9:47 p.m.
Message ID <20fe515f24d4ebb03ea4f181e9edc9e62d380836.1298492768.git.quintela@redhat.com>
Download mbox | patch
Permalink /patch/84247/
State New
Headers show

Comments

Juan Quintela - Feb. 23, 2011, 9:47 p.m.
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 migration.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/migration.c b/migration.c
index 1105757..e8e593d 100644
--- a/migration.c
+++ b/migration.c
@@ -139,9 +139,9 @@  int do_migrate_cancel(Monitor *mon, const QDict *qdict, QObject **ret_data)
 {
     MigrationState *s = current_migration;

-    if (s)
+    if (s && s->get_status(s) == MIG_STATE_ACTIVE) {
         s->cancel(s);
-
+    }
     return 0;
 }