qemu: fix domain device validation

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>
This commit is contained in:
Jonathon Jongsma
2019-11-14 11:37:50 -05:00
committed by Cole Robinson
parent 2552752f0b
commit ed831437af
+1 -1
View 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) {