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:
Juan Quintela 2010-05-11 22:39:51 +02:00
parent c0b2ba46c5
commit e649406169

View File

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