qemuMonitorJSONAddDeviceProps: Simplify construction of the command

Use 'qemuMonitorJSONMakeCommandInternal' instead of
'qemuMonitorJSONMakeCommand' + 'virJSONValueObjectAppend'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2021-10-13 17:06:15 +02:00
parent 2c1e3aa6f9
commit ab85f52c38
1 changed files with 2 additions and 5 deletions

View File

@ -4154,11 +4154,8 @@ qemuMonitorJSONAddDeviceProps(qemuMonitor *mon,
g_autoptr(virJSONValue) cmd = NULL;
g_autoptr(virJSONValue) reply = NULL;
if (!(cmd = qemuMonitorJSONMakeCommand("device_add", NULL)))
return -1;
if (virJSONValueObjectAppend(cmd, "arguments", props) < 0)
return -1;
if (!(cmd = qemuMonitorJSONMakeCommandInternal("device_add", props)))
return -1;
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
return -1;