From: Peter Krempa Date: Wed, 13 Oct 2021 15:06:15 +0000 (+0200) Subject: qemuMonitorJSONAddDeviceProps: Simplify construction of the command X-Git-Tag: v7.10.0-rc1~95 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab85f52c381ed31867687ffbbdd4a7cfdfbe1169;p=thirdparty%2Flibvirt.git qemuMonitorJSONAddDeviceProps: Simplify construction of the command Use 'qemuMonitorJSONMakeCommandInternal' instead of 'qemuMonitorJSONMakeCommand' + 'virJSONValueObjectAppend'. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index a3bdfaaf0d..2cfae2276d 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -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;