mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-30 18:50:18 +03:00
qemu: Add function to get bool value from migration params
Signed-off-by: Jim Fehlig <jfehlig@suse.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
61a095cfc7
commit
f80d59afe1
@ -1312,6 +1312,24 @@ qemuMigrationParamsGetULL(qemuMigrationParams *migParams,
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
qemuMigrationParamsGetBool(qemuMigrationParams *migParams,
|
||||
qemuMigrationParam param,
|
||||
bool *value)
|
||||
{
|
||||
if (!migParams || !value)
|
||||
return 0;
|
||||
|
||||
if (qemuMigrationParamsCheckType(param, QEMU_MIGRATION_PARAM_TYPE_BOOL) < 0)
|
||||
return -1;
|
||||
|
||||
*value = migParams->params[param].set ?
|
||||
migParams->params[param].value.b : false;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns true if @cap is enabled in @migParams, false otherwise.
|
||||
*/
|
||||
|
@ -137,6 +137,11 @@ qemuMigrationParamsGetULL(qemuMigrationParams *migParams,
|
||||
qemuMigrationParam param,
|
||||
unsigned long long *value);
|
||||
|
||||
int
|
||||
qemuMigrationParamsGetBool(qemuMigrationParams *migParams,
|
||||
qemuMigrationParam param,
|
||||
bool *value);
|
||||
|
||||
bool
|
||||
qemuMigrationParamsCapEnabled(qemuMigrationParams *migParams,
|
||||
qemuMigrationCapability cap);
|
||||
|
Loading…
x
Reference in New Issue
Block a user