mirror of https://github.com/xemu-project/xemu.git
migration: Make migration blocker work for snapshots too
save_snapshot() checks migration blocker, which looks sane. At the meantime we should also teach the blocker add helper to fail if during a snapshot, just like for migrations. Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
parent
0e21bf2460
commit
4c170330aa
|
@ -2058,15 +2058,16 @@ int migrate_add_blocker(Error *reason, Error **errp)
|
||||||
return -EACCES;
|
return -EACCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (migration_is_idle()) {
|
/* Snapshots are similar to migrations, so check RUN_STATE_SAVE_VM too. */
|
||||||
migration_blockers = g_slist_prepend(migration_blockers, reason);
|
if (runstate_check(RUN_STATE_SAVE_VM) || !migration_is_idle()) {
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
error_propagate_prepend(errp, error_copy(reason),
|
error_propagate_prepend(errp, error_copy(reason),
|
||||||
"disallowing migration blocker "
|
"disallowing migration blocker "
|
||||||
"(migration in progress) for: ");
|
"(migration/snapshot in progress) for: ");
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
|
}
|
||||||
|
|
||||||
|
migration_blockers = g_slist_prepend(migration_blockers, reason);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void migrate_del_blocker(Error *reason)
|
void migrate_del_blocker(Error *reason)
|
||||||
|
|
Loading…
Reference in New Issue