]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu_validate: Fix how qemuValidateDomainDeviceDefZPCIAddress() is called
authorMichal Privoznik <mprivozn@redhat.com>
Sat, 27 Jun 2020 08:49:37 +0000 (10:49 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 29 Jun 2020 10:38:24 +0000 (12:38 +0200)
To make the code future proof, the rest of the
qemuValidateDomainDeviceDefAddress() has to be executed (even
though there is nothing there yet) instead of returning directly.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
src/qemu/qemu_validate.c

index 78efa68584149a96110003fcc4c4aff8365f073d..6d0ffd20131c586b0720ba17c4ab22be2c40d566 100644 (file)
@@ -1057,7 +1057,9 @@ qemuValidateDomainDeviceDefAddress(const virDomainDeviceDef *dev,
 
     switch ((virDomainDeviceAddressType) info->type) {
     case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI:
-        return qemuValidateDomainDeviceDefZPCIAddress(info, qemuCaps);
+        if (qemuValidateDomainDeviceDefZPCIAddress(info, qemuCaps) < 0)
+            return -1;
+        break;
 
     case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE:
         /* Address validation might happen before we have had a chance to