diff mbox

[03/11] migration: Check that migration is active before cancel it

Message ID e149ab4fb8c6505b86c211a77ea9db9dc98ad427.1316781876.git.quintela@redhat.com
State New
Headers show

Commit Message

Juan Quintela Sept. 23, 2011, 12:50 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 531fe83..ea7bcc8 100644
--- a/migration.c
+++ b/migration.c
@@ -133,9 +133,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;
 }