render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
fbe740
From 5ec240811e391f97378d0b6b726e0dee13ae8a40 Mon Sep 17 00:00:00 2001
fbe740
Message-Id: <5ec240811e391f97378d0b6b726e0dee13ae8a40@dist-git>
fbe740
From: Laine Stump <laine@redhat.com>
fbe740
Date: Sun, 26 Apr 2020 13:17:03 -0400
fbe740
Subject: [PATCH] conf: during PCI hotplug, require that the controller support
fbe740
 hotplug
fbe740
fbe740
Before this patch we would simply rely on QEMU failing to attach the
fbe740
device. Since we have a flag in the address set telling us which
fbe740
controllers support hotplug, we can fail the operation sooner.
fbe740
fbe740
This also assures that when hotplugging with no provided PCI address,
fbe740
that we skip any controllers with hotplug='off', and attempt to assign
fbe740
the device to a controller that not only supports hotplug, but also
fbe740
has it enabled.
fbe740
fbe740
Signed-off-by: Laine Stump <laine@redhat.com>
fbe740
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
fbe740
(cherry picked from commit 7118bdee1550b6022e7362402ca8204add4cf80b)
fbe740
fbe740
https://bugzilla.redhat.com/1802592
fbe740
Signed-off-by: Laine Stump <laine@redhat.com>
fbe740
Message-Id: <20200426171703.18808-3-laine@redhat.com>
fbe740
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
fbe740
---
fbe740
 src/conf/domain_addr.c | 5 +++++
fbe740
 1 file changed, 5 insertions(+)
fbe740
fbe740
diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c
fbe740
index ed41eca114..34ea7bc051 100644
fbe740
--- a/src/conf/domain_addr.c
fbe740
+++ b/src/conf/domain_addr.c
fbe740
@@ -936,6 +936,11 @@ virDomainPCIAddressEnsureAddr(virDomainPCIAddressSetPtr addrs,
fbe740
     if (!flags)
fbe740
        return 0;
fbe740
 
fbe740
+    /* This function is only called during hotplug, so we require hotplug
fbe740
+     * support from the controller.
fbe740
+     */
fbe740
+    flags |= VIR_PCI_CONNECT_HOTPLUGGABLE;
fbe740
+
fbe740
     if (!(addrStr = virPCIDeviceAddressAsString(&dev->addr.pci)))
fbe740
         goto cleanup;
fbe740
 
fbe740
-- 
fbe740
2.26.2
fbe740