[libvirt PATCH 09/10] conf: check HOTPLUGGABLE connect flag when validating a PCI address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The HOTPLUGGABLE flag is set for appropriates buses in a PCI address
set, and thnis patch updates virDomainPCIAddressFlagsCompatible() to
check the HOTPLUGGABLE flag when searching for a suitable bus/slot for
a device. No devices request HOTPLUGGABLE though (yet), so there is no
observable effect.

Signed-off-by: Laine Stump <laine@xxxxxxxxxx>
---
 src/conf/domain_addr.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c
index b58989ac8b..580cf7e64d 100644
--- a/src/conf/domain_addr.c
+++ b/src/conf/domain_addr.c
@@ -376,6 +376,18 @@ virDomainPCIAddressFlagsCompatible(virPCIDeviceAddressPtr addr,
         return false;
     }
 
+    if ((devFlags & VIR_PCI_CONNECT_HOTPLUGGABLE) &&
+        !(busFlags & VIR_PCI_CONNECT_HOTPLUGGABLE)) {
+        if (reportError) {
+            virReportError(errType,
+                           _("The device at PCI address %s requires "
+                             "hotplug capability, but the PCI controller "
+                             "with index='%d' doesn't support hotplug"),
+                           addrStr, addr->bus);
+        }
+        return false;
+    }
+
     /* If this bus doesn't allow the type of connection (PCI
      * vs. PCIe) required by the device, or if the device requires
      * hot-plug and this bus doesn't have it, return false.
-- 
2.25.2





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux