[libvirt] [PATCH v2 3/6] qemu: fix domain device validation

Jonathon Jongsma jjongsma at redhat.com
Fri Oct 11 21:27:49 UTC 2019


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.

Signed-off-by: Jonathon Jongsma <jjongsma at redhat.com>
---
 src/qemu/qemu_domain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 516ae7e444..bc455e7da3 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -7213,7 +7213,7 @@ qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev,
     if ((ret = qemuDomainDeviceDefValidateAddress(dev, qemuCaps)) < 0)
         return ret;
 
-    if (virDomainCapsDeviceDefValidate(domCaps, dev, def) < 0)
+    if ((ret = virDomainCapsDeviceDefValidate(domCaps, dev, def)) < 0)
         return ret;
 
     switch ((virDomainDeviceType)dev->type) {
-- 
2.21.0




More information about the libvir-list mailing list