From e6494061690df2af7368752f35f5c22b5856e83c Mon Sep 17 00:00:00 2001 From: Juan Quintela Date: Tue, 11 May 2010 22:39:51 +0200 Subject: [PATCH] migration: Check that migration is active before cancel it Signed-off-by: Juan Quintela Reviewed-by: Anthony Liguori --- migration.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/migration.c b/migration.c index 7fd6c23fa5..71b8aade8b 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; }