]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: fix fromConfig argument to virDomainPCIAddressValidate()
authorLaine Stump <laine@laine.org>
Sat, 22 Oct 2016 16:53:17 +0000 (12:53 -0400)
committerLaine Stump <laine@laine.org>
Wed, 11 Jan 2017 09:51:54 +0000 (04:51 -0500)
fromConfig should be true if the caller wants
virDomainPCIAddressValidate() to loosen restrictions on its
interpretation of the pciConnectFlags. In particular, either
PCI_DEVICE or PCIE_DEVICE will be counted as equivalent to both, and
HOTPLUG will be ignored. In a few cases where libvirt was manually
overriding automatic address assignment, it was setting fromConfig to
false when validating the hardcoded manual override. This patch
changes those to fromConfig=true as a preemptive strike against any
future bugs that might otherwise surface.

src/conf/domain_addr.c
src/qemu/qemu_domain_address.c

index bf201e7a4d8f0166ab2b403e308f04bc99e60ca9..57ddef8504a6e56580608e27b30f84142b4aee37 100644 (file)
@@ -660,7 +660,7 @@ virDomainPCIAddressReleaseSlot(virDomainPCIAddressSetPtr addrs,
     if (!(addrStr = virDomainPCIAddressAsString(addr)))
         goto cleanup;
 
-    if (!virDomainPCIAddressValidate(addrs, addr, addrStr, flags, false))
+    if (!virDomainPCIAddressValidate(addrs, addr, addrStr, flags, true))
         goto cleanup;
 
     addrs->buses[addr->bus].slot[addr->slot].functions = 0;
index 69a64fdac54a870f0c7e7efd82e43a1dad5b9d1a..05de13d71b7b4b638437888468418bdcbbceceda 100644 (file)
@@ -1207,7 +1207,7 @@ qemuDomainValidateDevicePCISlotsPIIX3(virDomainDefPtr def,
             if (!(addrStr = virDomainPCIAddressAsString(&tmp_addr)))
                 goto cleanup;
             if (!virDomainPCIAddressValidate(addrs, &tmp_addr,
-                                             addrStr, flags, false))
+                                             addrStr, flags, true))
                 goto cleanup;
 
             if (virDomainPCIAddressSlotInUse(addrs, &tmp_addr)) {
@@ -1396,7 +1396,7 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def,
             if (!(addrStr = virDomainPCIAddressAsString(&tmp_addr)))
                 goto cleanup;
             if (!virDomainPCIAddressValidate(addrs, &tmp_addr,
-                                             addrStr, flags, false))
+                                             addrStr, flags, true))
                 goto cleanup;
 
             if (virDomainPCIAddressSlotInUse(addrs, &tmp_addr)) {