From: John Ferlan Date: Mon, 18 Jun 2018 11:35:38 +0000 (-0400) Subject: qemu: Fix qemuMonitorCreateObjectProps X-Git-Tag: v4.5.0-rc1~97 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d43cedcb8e647063377d2c692b7c541f507ef9e9;p=thirdparty%2Flibvirt.git qemu: Fix qemuMonitorCreateObjectProps Fix the return value status comparison checking for call to virJSONValueObjectCreateVArgs introduced by commit id f0a23c0c3. If a NULL arglist is passed, then a 0 is returned which is a valid status and we only should fail when the return is < 0. This resolves an issue seen for "virsh iothreadadd $dom $iothread" where a "error: An error occurred, but the cause is unknown" error was generated when trying to hotplug an IOThread to a domain since qemuDomainHotplugAddIOThread passes a NULL arglist. Signed-off-by: John Ferlan --- diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index b29672d4f1..d6771c1d52 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3051,7 +3051,7 @@ qemuMonitorCreateObjectProps(virJSONValuePtr *propsret, va_start(args, alias); - if (!(virJSONValueObjectCreateVArgs(&props, args))) + if (virJSONValueObjectCreateVArgs(&props, args) < 0) goto cleanup; if (!(*propsret = qemuMonitorCreateObjectPropsWrap(type, alias, &props)))