mirror of
https://github.com/qemu/qemu.git
synced 2024-12-05 01:33:41 +08:00
migration: provide migrate_cap_add()
Abstracted from migrate_set_block_enabled() to allocate MigrationCapabilityStatusList properly. Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <1500349150-13240-10-git-send-email-peterx@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
parent
4a84214ebe
commit
4e4a3d3aa6
@ -842,14 +842,27 @@ void migrate_set_state(int *state, int old_state, int new_state)
|
||||
}
|
||||
}
|
||||
|
||||
void migrate_set_block_enabled(bool value, Error **errp)
|
||||
static MigrationCapabilityStatusList *migrate_cap_add(
|
||||
MigrationCapabilityStatusList *list,
|
||||
MigrationCapability index,
|
||||
bool state)
|
||||
{
|
||||
MigrationCapabilityStatusList *cap;
|
||||
|
||||
cap = g_new0(MigrationCapabilityStatusList, 1);
|
||||
cap->value = g_new0(MigrationCapabilityStatus, 1);
|
||||
cap->value->capability = MIGRATION_CAPABILITY_BLOCK;
|
||||
cap->value->state = value;
|
||||
cap->value->capability = index;
|
||||
cap->value->state = state;
|
||||
cap->next = list;
|
||||
|
||||
return cap;
|
||||
}
|
||||
|
||||
void migrate_set_block_enabled(bool value, Error **errp)
|
||||
{
|
||||
MigrationCapabilityStatusList *cap;
|
||||
|
||||
cap = migrate_cap_add(NULL, MIGRATION_CAPABILITY_BLOCK, value);
|
||||
qmp_migrate_set_capabilities(cap, errp);
|
||||
qapi_free_MigrationCapabilityStatusList(cap);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user