]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: fix domain device validation
authorJonathon Jongsma <jjongsma@redhat.com>
Fri, 18 Oct 2019 15:30:09 +0000 (10:30 -0500)
committerCole Robinson <crobinso@redhat.com>
Thu, 14 Nov 2019 16:37:50 +0000 (11:37 -0500)
When the virDomainCapsDeviceDefValidate() function returned an error
status (-1), we were aborting the function early, but returning the
default return value (0). This patch properly returns an error in that
case.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
src/qemu/qemu_domain.c

index 7123f45cd72b3b42a1f66df8ab3689360f4d1f30..d3b6d61112552b384bcad217881ab0984980a334 100644 (file)
@@ -7225,7 +7225,7 @@ qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev,
     if ((ret = qemuDomainDeviceDefValidateAddress(dev, qemuCaps)) < 0)
         goto cleanup;
 
-    if (virDomainCapsDeviceDefValidate(domCaps, dev, def) < 0)
+    if ((ret = virDomainCapsDeviceDefValidate(domCaps, dev, def)) < 0)
         goto cleanup;
 
     switch ((virDomainDeviceType)dev->type) {