mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-01 17:35:17 +00:00
qemu: monitor: Use VIR_AUTOPTR in qemuMonitorJSON(Drive/Blockdev)Mirror
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
e90d51c4d0
commit
c74b898d4c
@ -4280,9 +4280,8 @@ qemuMonitorJSONDriveMirror(qemuMonitorPtr mon,
|
||||
bool shallow,
|
||||
bool reuse)
|
||||
{
|
||||
int ret = -1;
|
||||
virJSONValuePtr cmd;
|
||||
virJSONValuePtr reply = NULL;
|
||||
VIR_AUTOPTR(virJSONValue) cmd = NULL;
|
||||
VIR_AUTOPTR(virJSONValue) reply = NULL;
|
||||
|
||||
cmd = qemuMonitorJSONMakeCommand("drive-mirror",
|
||||
"s:device", device,
|
||||
@ -4298,16 +4297,9 @@ qemuMonitorJSONDriveMirror(qemuMonitorPtr mon,
|
||||
return -1;
|
||||
|
||||
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
|
||||
goto cleanup;
|
||||
return -1;
|
||||
|
||||
if (qemuMonitorJSONCheckError(cmd, reply) < 0)
|
||||
goto cleanup;
|
||||
|
||||
ret = 0;
|
||||
cleanup:
|
||||
virJSONValueFree(cmd);
|
||||
virJSONValueFree(reply);
|
||||
return ret;
|
||||
return qemuMonitorJSONCheckError(cmd, reply);
|
||||
}
|
||||
|
||||
|
||||
@ -4321,9 +4313,8 @@ qemuMonitorJSONBlockdevMirror(qemuMonitorPtr mon,
|
||||
unsigned long long buf_size,
|
||||
bool shallow)
|
||||
{
|
||||
int ret = -1;
|
||||
virJSONValuePtr cmd;
|
||||
virJSONValuePtr reply = NULL;
|
||||
VIR_AUTOPTR(virJSONValue) cmd = NULL;
|
||||
VIR_AUTOPTR(virJSONValue) reply = NULL;
|
||||
|
||||
cmd = qemuMonitorJSONMakeCommand("blockdev-mirror",
|
||||
"S:job-id", jobname,
|
||||
@ -4337,14 +4328,10 @@ qemuMonitorJSONBlockdevMirror(qemuMonitorPtr mon,
|
||||
if (!cmd)
|
||||
return -1;
|
||||
|
||||
if ((ret = qemuMonitorJSONCommand(mon, cmd, &reply)) < 0)
|
||||
goto cleanup;
|
||||
ret = qemuMonitorJSONCheckError(cmd, reply);
|
||||
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
|
||||
return -1;
|
||||
|
||||
cleanup:
|
||||
virJSONValueFree(cmd);
|
||||
virJSONValueFree(reply);
|
||||
return ret;
|
||||
return qemuMonitorJSONCheckError(cmd, reply);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user