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

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