mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 09:55:18 +00:00
qemu: Use g_autoptr in qemuMonitorJSONSetCapabilities
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
90a5be6416
commit
d5c9acc166
@ -1644,23 +1644,20 @@ qemuMonitorJSONHumanCommand(qemuMonitorPtr mon,
|
|||||||
int
|
int
|
||||||
qemuMonitorJSONSetCapabilities(qemuMonitorPtr mon)
|
qemuMonitorJSONSetCapabilities(qemuMonitorPtr mon)
|
||||||
{
|
{
|
||||||
int ret = -1;
|
g_autoptr(virJSONValue) cmd = NULL;
|
||||||
virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("qmp_capabilities", NULL);
|
g_autoptr(virJSONValue) reply = NULL;
|
||||||
virJSONValuePtr reply = NULL;
|
|
||||||
if (!cmd)
|
if (!(cmd = qemuMonitorJSONMakeCommand("qmp_capabilities",
|
||||||
|
NULL)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
|
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
|
||||||
goto cleanup;
|
return -1;
|
||||||
|
|
||||||
if (qemuMonitorJSONCheckError(cmd, reply) < 0)
|
if (qemuMonitorJSONCheckError(cmd, reply) < 0)
|
||||||
goto cleanup;
|
return -1;
|
||||||
|
|
||||||
ret = 0;
|
return 0;
|
||||||
cleanup:
|
|
||||||
virJSONValueFree(cmd);
|
|
||||||
virJSONValueFree(reply);
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user