提交 0b52b023 编写于 作者: P Peter Krempa

qemuMonitorJSONGetDeviceProps: Refactor to modern standards

Use automatic cleanup of variables and current style of header.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
上级 d3035e13
......@@ -6745,13 +6745,13 @@ qemuMonitorJSONParsePropsList(virJSONValuePtr cmd,
}
int qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon,
const char *device,
char ***props)
int
qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon,
const char *device,
char ***props)
{
int ret = -1;
virJSONValuePtr cmd;
virJSONValuePtr reply = NULL;
g_autoptr(virJSONValue) cmd = NULL;
g_autoptr(virJSONValue) reply = NULL;
*props = NULL;
......@@ -6761,18 +6761,12 @@ int qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon,
return -1;
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
goto cleanup;
return -1;
if (qemuMonitorJSONHasError(reply, "DeviceNotFound")) {
ret = 0;
goto cleanup;
}
if (qemuMonitorJSONHasError(reply, "DeviceNotFound"))
return 0;
ret = qemuMonitorJSONParsePropsList(cmd, reply, NULL, props);
cleanup:
virJSONValueFree(reply);
virJSONValueFree(cmd);
return ret;
return qemuMonitorJSONParsePropsList(cmd, reply, NULL, props);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册