mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
qemu_monitor: Add API for checking CPU migratable property
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
parent
d32cde0ea2
commit
c7afaa69cd
@ -4526,6 +4526,24 @@ qemuMonitorGetJobInfo(qemuMonitorPtr mon,
|
||||
}
|
||||
|
||||
|
||||
/* qemuMonitorGetCPUMigratable:
|
||||
*
|
||||
* Get the migratable property of the CPU object.
|
||||
*
|
||||
* Returns -1 on error,
|
||||
* 1 when the property is not supported,
|
||||
* 0 on success (@migratable is set accordingly).
|
||||
*/
|
||||
int
|
||||
qemuMonitorGetCPUMigratable(qemuMonitorPtr mon,
|
||||
bool *migratable)
|
||||
{
|
||||
QEMU_CHECK_MONITOR(mon);
|
||||
|
||||
return qemuMonitorJSONGetCPUMigratable(mon, migratable);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
qemuMonitorTransactionBitmapAdd(virJSONValuePtr actions,
|
||||
const char *node,
|
||||
|
@ -1377,6 +1377,10 @@ int qemuMonitorGetJobInfo(qemuMonitorPtr mon,
|
||||
qemuMonitorJobInfoPtr **jobs,
|
||||
size_t *njobs);
|
||||
|
||||
int
|
||||
qemuMonitorGetCPUMigratable(qemuMonitorPtr mon,
|
||||
bool *migratable);
|
||||
|
||||
int
|
||||
qemuMonitorTransactionBitmapAdd(virJSONValuePtr actions,
|
||||
const char *node,
|
||||
|
@ -9388,3 +9388,30 @@ qemuMonitorJSONGetJobInfo(qemuMonitorPtr mon,
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
qemuMonitorJSONGetCPUMigratable(qemuMonitorPtr mon,
|
||||
bool *migratable)
|
||||
{
|
||||
g_autoptr(virJSONValue) cmd = NULL;
|
||||
g_autoptr(virJSONValue) reply = NULL;
|
||||
|
||||
if (!(cmd = qemuMonitorJSONMakeCommand("qom-get",
|
||||
"s:path", QOM_CPU_PATH,
|
||||
"s:property", "migratable",
|
||||
NULL)))
|
||||
return -1;
|
||||
|
||||
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
|
||||
return -1;
|
||||
|
||||
if (qemuMonitorJSONHasError(reply, "GenericError"))
|
||||
return 1;
|
||||
|
||||
if (qemuMonitorJSONCheckReply(cmd, reply, VIR_JSON_TYPE_BOOLEAN) < 0)
|
||||
return -1;
|
||||
|
||||
return virJSONValueGetBoolean(virJSONValueObjectGet(reply, "return"),
|
||||
migratable);
|
||||
}
|
||||
|
@ -690,3 +690,7 @@ int qemuMonitorJSONSetDBusVMStateIdList(qemuMonitorPtr mon,
|
||||
const char *vmstatepath,
|
||||
const char **list)
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
|
||||
|
||||
int
|
||||
qemuMonitorJSONGetCPUMigratable(qemuMonitorPtr mon,
|
||||
bool *migratable);
|
||||
|
Loading…
Reference in New Issue
Block a user