]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Fix qemuMonitorCreateObjectProps
authorJohn Ferlan <jferlan@redhat.com>
Mon, 18 Jun 2018 11:35:38 +0000 (07:35 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 18 Jun 2018 21:08:38 +0000 (17:08 -0400)
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 <jferlan@redhat.com>
src/qemu/qemu_monitor.c

index b29672d4f19bad7ca718b41f9bfa12a4c24af115..d6771c1d52241f895ab9756327d07a54e0a6e2e5 100644 (file)
@@ -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)))