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

Submitted by Juan Quintela on Feb. 23, 2011, 9:47 p.m.

Details

Message ID 20fe515f24d4ebb03ea4f181e9edc9e62d380836.1298492768.git.quintela@redhat.com
State New
Headers show

Commit Message

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 hide | download patch | download mbox

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;
 }