migration: Check that migration is active before cancel it
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
c0b2ba46c5
commit
e649406169
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user