]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuMonitorJSONAddDeviceProps: Simplify construction of the command
authorPeter Krempa <pkrempa@redhat.com>
Wed, 13 Oct 2021 15:06:15 +0000 (17:06 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 19 Nov 2021 11:38:34 +0000 (12:38 +0100)
Use 'qemuMonitorJSONMakeCommandInternal' instead of
'qemuMonitorJSONMakeCommand' + 'virJSONValueObjectAppend'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_monitor_json.c

index a3bdfaaf0d473c8b15df81f5d0608f9c83852a22..2cfae2276dbb164f714038880090d15adc761321 100644 (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;