mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
migration: Add migrate_add_blocker_internal()
An internal version that removes -only-migratable implications. It can be used for temporary migration blockers like dump-guest-memory. Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
parent
4c170330aa
commit
60fd680193
2 changed files with 29 additions and 8 deletions
|
@ -2049,15 +2049,8 @@ void migrate_init(MigrationState *s)
|
|||
s->threshold_size = 0;
|
||||
}
|
||||
|
||||
int migrate_add_blocker(Error *reason, Error **errp)
|
||||
int migrate_add_blocker_internal(Error *reason, Error **errp)
|
||||
{
|
||||
if (only_migratable) {
|
||||
error_propagate_prepend(errp, error_copy(reason),
|
||||
"disallowing migration blocker "
|
||||
"(--only-migratable) for: ");
|
||||
return -EACCES;
|
||||
}
|
||||
|
||||
/* Snapshots are similar to migrations, so check RUN_STATE_SAVE_VM too. */
|
||||
if (runstate_check(RUN_STATE_SAVE_VM) || !migration_is_idle()) {
|
||||
error_propagate_prepend(errp, error_copy(reason),
|
||||
|
@ -2070,6 +2063,18 @@ int migrate_add_blocker(Error *reason, Error **errp)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int migrate_add_blocker(Error *reason, Error **errp)
|
||||
{
|
||||
if (only_migratable) {
|
||||
error_propagate_prepend(errp, error_copy(reason),
|
||||
"disallowing migration blocker "
|
||||
"(--only-migratable) for: ");
|
||||
return -EACCES;
|
||||
}
|
||||
|
||||
return migrate_add_blocker_internal(reason, errp);
|
||||
}
|
||||
|
||||
void migrate_del_blocker(Error *reason)
|
||||
{
|
||||
migration_blockers = g_slist_remove(migration_blockers, reason);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue