Blame SOURCES/libvirt-conf-qemu-s-VIR_PCI_CONNECT_HOTPLUGGABLE-VIR_PCI_CONNECT_AUTOASSIGN-g.patch

fbe740
From 4f2bf4edfb640c38281d63e54145433ce8a78d28 Mon Sep 17 00:00:00 2001
fbe740
Message-Id: <4f2bf4edfb640c38281d63e54145433ce8a78d28@dist-git>
fbe740
From: Laine Stump <laine@redhat.com>
fbe740
Date: Sun, 26 Apr 2020 13:04:11 -0400
fbe740
Subject: [PATCH] conf/qemu:
fbe740
 s/VIR_PCI_CONNECT_HOTPLUGGABLE/VIR_PCI_CONNECT_AUTOASSIGN/g
fbe740
fbe740
When the HOTPLUGGABLE flag was originally added, it was set for all
fbe740
the PCI controllers that accepted hotplugged devices, and requested
fbe740
for all devices that were auto-assigned to a controller. While we're
fbe740
still autoassigning to the same list of controllers, those controllers
fbe740
may or may not support hotplug, so let's use the flag that fits what
fbe740
we're actually doing.
fbe740
fbe740
Signed-off-by: Laine Stump <laine@redhat.com>
fbe740
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
fbe740
(cherry picked from commit 7c98f5e3652e19e4eb015d290c1eed2f1b58ee72)
fbe740
fbe740
https://bugzilla.redhat.com/1802592
fbe740
Signed-off-by: Laine Stump <laine@redhat.com>
fbe740
Message-Id: <20200426170415.18328-9-laine@redhat.com>
fbe740
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
fbe740
---
fbe740
 src/conf/domain_addr.c         | 18 +++++++++---------
fbe740
 src/qemu/qemu_domain_address.c | 14 +++++++-------
fbe740
 2 files changed, 16 insertions(+), 16 deletions(-)
fbe740
fbe740
diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c
fbe740
index e0be655772..53be6cd34b 100644
fbe740
--- a/src/conf/domain_addr.c
fbe740
+++ b/src/conf/domain_addr.c
fbe740
@@ -362,8 +362,8 @@ virDomainPCIAddressFlagsCompatible(virPCIDeviceAddressPtr addr,
fbe740
          * libvirt's assumptions about whether or not hotplug
fbe740
          * capability will be required.
fbe740
          */
fbe740
-        if (devFlags & VIR_PCI_CONNECT_HOTPLUGGABLE)
fbe740
-            busFlags |= VIR_PCI_CONNECT_HOTPLUGGABLE;
fbe740
+        if (devFlags & VIR_PCI_CONNECT_AUTOASSIGN)
fbe740
+            busFlags |= VIR_PCI_CONNECT_AUTOASSIGN;
fbe740
         /* if the device is a pci-bridge, allow manually
fbe740
          * assigning to any bus that would also accept a
fbe740
          * standard PCI device.
fbe740
@@ -419,8 +419,8 @@ virDomainPCIAddressFlagsCompatible(virPCIDeviceAddressPtr addr,
fbe740
                        addrStr, addr->bus, connectStr);
fbe740
         return false;
fbe740
     }
fbe740
-    if ((devFlags & VIR_PCI_CONNECT_HOTPLUGGABLE) &&
fbe740
-        !(busFlags & VIR_PCI_CONNECT_HOTPLUGGABLE)) {
fbe740
+    if ((devFlags & VIR_PCI_CONNECT_AUTOASSIGN) &&
fbe740
+        !(busFlags & VIR_PCI_CONNECT_AUTOASSIGN)) {
fbe740
         if (reportError) {
fbe740
             virReportError(errType,
fbe740
                            _("The device at PCI address %s requires "
fbe740
@@ -509,7 +509,7 @@ virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus,
fbe740
      */
fbe740
     switch (model) {
fbe740
     case VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT:
fbe740
-        bus->flags = (VIR_PCI_CONNECT_HOTPLUGGABLE |
fbe740
+        bus->flags = (VIR_PCI_CONNECT_AUTOASSIGN |
fbe740
                       VIR_PCI_CONNECT_TYPE_PCI_DEVICE |
fbe740
                       VIR_PCI_CONNECT_TYPE_PCI_BRIDGE |
fbe740
                       VIR_PCI_CONNECT_TYPE_PCI_EXPANDER_BUS);
fbe740
@@ -517,14 +517,14 @@ virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus,
fbe740
         bus->maxSlot = VIR_PCI_ADDRESS_SLOT_LAST;
fbe740
         break;
fbe740
     case VIR_DOMAIN_CONTROLLER_MODEL_PCI_BRIDGE:
fbe740
-        bus->flags = (VIR_PCI_CONNECT_HOTPLUGGABLE |
fbe740
+        bus->flags = (VIR_PCI_CONNECT_AUTOASSIGN |
fbe740
                       VIR_PCI_CONNECT_TYPE_PCI_DEVICE |
fbe740
                       VIR_PCI_CONNECT_TYPE_PCI_BRIDGE);
fbe740
         bus->minSlot = 1;
fbe740
         bus->maxSlot = VIR_PCI_ADDRESS_SLOT_LAST;
fbe740
         break;
fbe740
     case VIR_DOMAIN_CONTROLLER_MODEL_PCI_EXPANDER_BUS:
fbe740
-        bus->flags = (VIR_PCI_CONNECT_HOTPLUGGABLE |
fbe740
+        bus->flags = (VIR_PCI_CONNECT_AUTOASSIGN |
fbe740
                       VIR_PCI_CONNECT_TYPE_PCI_DEVICE |
fbe740
                       VIR_PCI_CONNECT_TYPE_PCI_BRIDGE);
fbe740
         bus->minSlot = 0;
fbe740
@@ -555,7 +555,7 @@ virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus,
fbe740
     case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_TO_PCI_BRIDGE:
fbe740
         /* Same as pci-bridge: 32 hotpluggable traditional PCI slots (0-31),
fbe740
          * the first of which is not usable because of the SHPC */
fbe740
-        bus->flags = (VIR_PCI_CONNECT_HOTPLUGGABLE |
fbe740
+        bus->flags = (VIR_PCI_CONNECT_AUTOASSIGN |
fbe740
                       VIR_PCI_CONNECT_TYPE_PCI_DEVICE |
fbe740
                       VIR_PCI_CONNECT_TYPE_PCI_BRIDGE);
fbe740
         bus->minSlot = 1;
fbe740
@@ -566,7 +566,7 @@ virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus,
fbe740
         /* provides one slot which is pcie, can be used by endpoint
fbe740
          * devices, pcie-switch-upstream-ports or pcie-to-pci-bridges,
fbe740
          * and is hotpluggable */
fbe740
-        bus->flags = (VIR_PCI_CONNECT_HOTPLUGGABLE |
fbe740
+        bus->flags = (VIR_PCI_CONNECT_AUTOASSIGN |
fbe740
                       VIR_PCI_CONNECT_TYPE_PCIE_DEVICE |
fbe740
                       VIR_PCI_CONNECT_TYPE_PCIE_SWITCH_UPSTREAM_PORT |
fbe740
                       VIR_PCI_CONNECT_TYPE_PCIE_TO_PCI_BRIDGE);
fbe740
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
fbe740
index 3c6ac62ff5..e81585bc6c 100644
fbe740
--- a/src/qemu/qemu_domain_address.c
fbe740
+++ b/src/qemu/qemu_domain_address.c
fbe740
@@ -571,7 +571,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev,
fbe740
                                          virDomainPCIConnectFlags virtioFlags)
fbe740
 {
fbe740
     virDomainPCIConnectFlags pciFlags = (VIR_PCI_CONNECT_TYPE_PCI_DEVICE |
fbe740
-                                         VIR_PCI_CONNECT_HOTPLUGGABLE);
fbe740
+                                         VIR_PCI_CONNECT_AUTOASSIGN);
fbe740
 
fbe740
     switch ((virDomainDeviceType)dev->type) {
fbe740
     case VIR_DOMAIN_DEVICE_CONTROLLER: {
fbe740
@@ -1063,17 +1063,17 @@ qemuDomainFillDevicePCIConnectFlagsIterInit(virDomainDefPtr def,
fbe740
 
fbe740
     if (qemuDomainHasPCIeRoot(def)) {
fbe740
         data->pcieFlags = (VIR_PCI_CONNECT_TYPE_PCIE_DEVICE |
fbe740
-                           VIR_PCI_CONNECT_HOTPLUGGABLE);
fbe740
+                           VIR_PCI_CONNECT_AUTOASSIGN);
fbe740
     } else {
fbe740
         data->pcieFlags = (VIR_PCI_CONNECT_TYPE_PCI_DEVICE |
fbe740
-                           VIR_PCI_CONNECT_HOTPLUGGABLE);
fbe740
+                           VIR_PCI_CONNECT_AUTOASSIGN);
fbe740
     }
fbe740
 
fbe740
     if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY)) {
fbe740
         data->virtioFlags = data->pcieFlags;
fbe740
     } else {
fbe740
         data->virtioFlags = (VIR_PCI_CONNECT_TYPE_PCI_DEVICE |
fbe740
-                             VIR_PCI_CONNECT_HOTPLUGGABLE);
fbe740
+                             VIR_PCI_CONNECT_AUTOASSIGN);
fbe740
     }
fbe740
 }
fbe740
 
fbe740
@@ -1729,7 +1729,7 @@ qemuDomainValidateDevicePCISlotsPIIX3(virDomainDefPtr def,
fbe740
     virPCIDeviceAddress tmp_addr;
fbe740
     bool qemuDeviceVideoUsable = virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY);
fbe740
     g_autofree char *addrStr = NULL;
fbe740
-    virDomainPCIConnectFlags flags = (VIR_PCI_CONNECT_HOTPLUGGABLE
fbe740
+    virDomainPCIConnectFlags flags = (VIR_PCI_CONNECT_AUTOASSIGN
fbe740
                                       | VIR_PCI_CONNECT_TYPE_PCI_DEVICE);
fbe740
 
fbe740
     /* Verify that first IDE and USB controllers (if any) is on the PIIX3, fn 1 */
fbe740
@@ -2666,7 +2666,7 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def,
fbe740
              * domain.
fbe740
              */
fbe740
             virDomainDeviceInfo info = {
fbe740
-                .pciConnectFlags = (VIR_PCI_CONNECT_HOTPLUGGABLE |
fbe740
+                .pciConnectFlags = (VIR_PCI_CONNECT_AUTOASSIGN |
fbe740
                                     VIR_PCI_CONNECT_TYPE_PCI_DEVICE),
fbe740
                 .pciAddrExtFlags = VIR_PCI_ADDRESS_EXTENSION_NONE
fbe740
             };
fbe740
@@ -2707,7 +2707,7 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def,
fbe740
             addrs->nbuses > max_idx + 1 &&
fbe740
             qemuDomainHasPCIeRoot(def)) {
fbe740
             virDomainDeviceInfo info = {
fbe740
-                .pciConnectFlags = (VIR_PCI_CONNECT_HOTPLUGGABLE |
fbe740
+                .pciConnectFlags = (VIR_PCI_CONNECT_AUTOASSIGN |
fbe740
                                     VIR_PCI_CONNECT_TYPE_PCIE_DEVICE),
fbe740
                 .pciAddrExtFlags = VIR_PCI_ADDRESS_EXTENSION_NONE
fbe740
             };
fbe740
-- 
fbe740
2.26.2
fbe740