[libvirt PATCH 06/10] conf/qemu: s/VIR_PCI_CONNECT_HOTPLUGGABLE/VIR_PCI_CONNECT_AUTOASSIGN/g

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

 



When the HOTPLUGGABLE flag was originally added, it was set for all
the PCI controllers that accepted hotplugged devices, and requested
for all devices that were auto-assigned to a controller. While we're
still autoassigning to the same list of controllers, those controllers
may or may not support hotplug, so let's use the flag that fits what
we're actually doing.

Signed-off-by: Laine Stump <laine@xxxxxxxxxx>
---
 src/conf/domain_addr.c         | 18 +++++++++---------
 src/qemu/qemu_domain_address.c | 14 +++++++-------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c
index e8629b3ed8..effc223a12 100644
--- a/src/conf/domain_addr.c
+++ b/src/conf/domain_addr.c
@@ -362,8 +362,8 @@ virDomainPCIAddressFlagsCompatible(virPCIDeviceAddressPtr addr,
          * libvirt's assumptions about whether or not hotplug
          * capability will be required.
          */
-        if (devFlags & VIR_PCI_CONNECT_HOTPLUGGABLE)
-            busFlags |= VIR_PCI_CONNECT_HOTPLUGGABLE;
+        if (devFlags & VIR_PCI_CONNECT_AUTOASSIGN)
+            busFlags |= VIR_PCI_CONNECT_AUTOASSIGN;
         /* if the device is a pci-bridge, allow manually
          * assigning to any bus that would also accept a
          * standard PCI device.
@@ -419,8 +419,8 @@ virDomainPCIAddressFlagsCompatible(virPCIDeviceAddressPtr addr,
                        addrStr, addr->bus, connectStr);
         return false;
     }
-    if ((devFlags & VIR_PCI_CONNECT_HOTPLUGGABLE) &&
-        !(busFlags & VIR_PCI_CONNECT_HOTPLUGGABLE)) {
+    if ((devFlags & VIR_PCI_CONNECT_AUTOASSIGN) &&
+        !(busFlags & VIR_PCI_CONNECT_AUTOASSIGN)) {
         if (reportError) {
             virReportError(errType,
                            _("The device at PCI address %s requires "
@@ -509,7 +509,7 @@ virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus,
      */
     switch (model) {
     case VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT:
-        bus->flags = (VIR_PCI_CONNECT_HOTPLUGGABLE |
+        bus->flags = (VIR_PCI_CONNECT_AUTOASSIGN |
                       VIR_PCI_CONNECT_TYPE_PCI_DEVICE |
                       VIR_PCI_CONNECT_TYPE_PCI_BRIDGE |
                       VIR_PCI_CONNECT_TYPE_PCI_EXPANDER_BUS);
@@ -517,14 +517,14 @@ virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus,
         bus->maxSlot = VIR_PCI_ADDRESS_SLOT_LAST;
         break;
     case VIR_DOMAIN_CONTROLLER_MODEL_PCI_BRIDGE:
-        bus->flags = (VIR_PCI_CONNECT_HOTPLUGGABLE |
+        bus->flags = (VIR_PCI_CONNECT_AUTOASSIGN |
                       VIR_PCI_CONNECT_TYPE_PCI_DEVICE |
                       VIR_PCI_CONNECT_TYPE_PCI_BRIDGE);
         bus->minSlot = 1;
         bus->maxSlot = VIR_PCI_ADDRESS_SLOT_LAST;
         break;
     case VIR_DOMAIN_CONTROLLER_MODEL_PCI_EXPANDER_BUS:
-        bus->flags = (VIR_PCI_CONNECT_HOTPLUGGABLE |
+        bus->flags = (VIR_PCI_CONNECT_AUTOASSIGN |
                       VIR_PCI_CONNECT_TYPE_PCI_DEVICE |
                       VIR_PCI_CONNECT_TYPE_PCI_BRIDGE);
         bus->minSlot = 0;
@@ -555,7 +555,7 @@ virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus,
     case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_TO_PCI_BRIDGE:
         /* Same as pci-bridge: 32 hotpluggable traditional PCI slots (0-31),
          * the first of which is not usable because of the SHPC */
-        bus->flags = (VIR_PCI_CONNECT_HOTPLUGGABLE |
+        bus->flags = (VIR_PCI_CONNECT_AUTOASSIGN |
                       VIR_PCI_CONNECT_TYPE_PCI_DEVICE |
                       VIR_PCI_CONNECT_TYPE_PCI_BRIDGE);
         bus->minSlot = 1;
@@ -566,7 +566,7 @@ virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus,
         /* provides one slot which is pcie, can be used by endpoint
          * devices, pcie-switch-upstream-ports or pcie-to-pci-bridges,
          * and is hotpluggable */
-        bus->flags = (VIR_PCI_CONNECT_HOTPLUGGABLE |
+        bus->flags = (VIR_PCI_CONNECT_AUTOASSIGN |
                       VIR_PCI_CONNECT_TYPE_PCIE_DEVICE |
                       VIR_PCI_CONNECT_TYPE_PCIE_SWITCH_UPSTREAM_PORT |
                       VIR_PCI_CONNECT_TYPE_PCIE_TO_PCI_BRIDGE);
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index ab6bce19f4..f853d2003d 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -580,7 +580,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev,
                                          virDomainPCIConnectFlags virtioFlags)
 {
     virDomainPCIConnectFlags pciFlags = (VIR_PCI_CONNECT_TYPE_PCI_DEVICE |
-                                         VIR_PCI_CONNECT_HOTPLUGGABLE);
+                                         VIR_PCI_CONNECT_AUTOASSIGN);
 
     switch ((virDomainDeviceType)dev->type) {
     case VIR_DOMAIN_DEVICE_CONTROLLER: {
@@ -1072,17 +1072,17 @@ qemuDomainFillDevicePCIConnectFlagsIterInit(virDomainDefPtr def,
 
     if (qemuDomainHasPCIeRoot(def)) {
         data->pcieFlags = (VIR_PCI_CONNECT_TYPE_PCIE_DEVICE |
-                           VIR_PCI_CONNECT_HOTPLUGGABLE);
+                           VIR_PCI_CONNECT_AUTOASSIGN);
     } else {
         data->pcieFlags = (VIR_PCI_CONNECT_TYPE_PCI_DEVICE |
-                           VIR_PCI_CONNECT_HOTPLUGGABLE);
+                           VIR_PCI_CONNECT_AUTOASSIGN);
     }
 
     if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY)) {
         data->virtioFlags = data->pcieFlags;
     } else {
         data->virtioFlags = (VIR_PCI_CONNECT_TYPE_PCI_DEVICE |
-                             VIR_PCI_CONNECT_HOTPLUGGABLE);
+                             VIR_PCI_CONNECT_AUTOASSIGN);
     }
 }
 
@@ -1736,7 +1736,7 @@ qemuDomainValidateDevicePCISlotsPIIX3(virDomainDefPtr def,
     virPCIDeviceAddress tmp_addr;
     bool qemuDeviceVideoUsable = virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY);
     g_autofree char *addrStr = NULL;
-    virDomainPCIConnectFlags flags = (VIR_PCI_CONNECT_HOTPLUGGABLE
+    virDomainPCIConnectFlags flags = (VIR_PCI_CONNECT_AUTOASSIGN
                                       | VIR_PCI_CONNECT_TYPE_PCI_DEVICE);
 
     /* Verify that first IDE and USB controllers (if any) is on the PIIX3, fn 1 */
@@ -2673,7 +2673,7 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def,
              * domain.
              */
             virDomainDeviceInfo info = {
-                .pciConnectFlags = (VIR_PCI_CONNECT_HOTPLUGGABLE |
+                .pciConnectFlags = (VIR_PCI_CONNECT_AUTOASSIGN |
                                     VIR_PCI_CONNECT_TYPE_PCI_DEVICE),
                 .pciAddrExtFlags = VIR_PCI_ADDRESS_EXTENSION_NONE
             };
@@ -2714,7 +2714,7 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def,
             addrs->nbuses > max_idx + 1 &&
             qemuDomainHasPCIeRoot(def)) {
             virDomainDeviceInfo info = {
-                .pciConnectFlags = (VIR_PCI_CONNECT_HOTPLUGGABLE |
+                .pciConnectFlags = (VIR_PCI_CONNECT_AUTOASSIGN |
                                     VIR_PCI_CONNECT_TYPE_PCIE_DEVICE),
                 .pciAddrExtFlags = VIR_PCI_ADDRESS_EXTENSION_NONE
             };
-- 
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