diff mbox

[3/7] migration: Check that migration is active before cancel it

Message ID 7763b0c43dadb553b0310f99c079e5eea2c11272.1316524908.git.quintela@redhat.com
State New
Headers show

Commit Message

Juan Quintela Sept. 20, 2011, 1:24 p.m. UTC
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 migration.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/migration.c b/migration.c
index 15d001e..c56d29c 100644
--- a/migration.c
+++ b/migration.c
@@ -132,9 +132,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;
 }