mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-26 14:03:49 +03:00
qemuMonitorJSONQueryBlockstats: Refactor cleanup
Use automatic memory clearing and remove the cleanup label. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
d7050b0d08
commit
4e950ba4b4
@ -2520,25 +2520,19 @@ qemuMonitorJSONGetOneBlockStatsInfo(virJSONValue *dev,
|
||||
virJSONValue *
|
||||
qemuMonitorJSONQueryBlockstats(qemuMonitor *mon)
|
||||
{
|
||||
virJSONValue *cmd;
|
||||
virJSONValue *reply = NULL;
|
||||
virJSONValue *ret = NULL;
|
||||
g_autoptr(virJSONValue) cmd = NULL;
|
||||
g_autoptr(virJSONValue) reply = NULL;
|
||||
|
||||
if (!(cmd = qemuMonitorJSONMakeCommand("query-blockstats", NULL)))
|
||||
return NULL;
|
||||
|
||||
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
|
||||
goto cleanup;
|
||||
return NULL;
|
||||
|
||||
if (qemuMonitorJSONCheckReply(cmd, reply, VIR_JSON_TYPE_ARRAY) < 0)
|
||||
goto cleanup;
|
||||
return NULL;
|
||||
|
||||
ret = virJSONValueObjectStealArray(reply, "return");
|
||||
|
||||
cleanup:
|
||||
virJSONValueFree(cmd);
|
||||
virJSONValueFree(reply);
|
||||
return ret;
|
||||
return virJSONValueObjectStealArray(reply, "return");
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user