[libvirt PATCH 10/10] conf: during PCI hotplug, require that the controller support hotplug

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

 



Before this patch we would simply rely on QEMU failing to attach the
device. Since we have a flag in the address set telling us which
controllers support hotplug, we can fail the operation sooner.

This also assures that when hotplugging with no provided PCI address,
that we skip any controllers with hotplug='off', and attempt to assign
the device to a controller that not only supports hotplug, but also
has it enabled.

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

diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c
index 580cf7e64d..5652bc9a33 100644
--- a/src/conf/domain_addr.c
+++ b/src/conf/domain_addr.c
@@ -931,6 +931,11 @@ virDomainPCIAddressEnsureAddr(virDomainPCIAddressSetPtr addrs,
     if (!flags)
        return 0;
 
+    /* This function is only called during hotplug, so we require hotplug
+     * support from the controller.
+     */
+    flags |= VIR_PCI_CONNECT_HOTPLUGGABLE;
+
     if (!(addrStr = virPCIDeviceAddressAsString(&dev->addr.pci)))
         return -1;
 
-- 
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