render / rpms / libvirt

Forked from rpms/libvirt 5 months ago
Clone
b971b8
From 2780cb41f7682741be2bbe662d629dd1bd3b4f6e Mon Sep 17 00:00:00 2001
b971b8
Message-Id: <2780cb41f7682741be2bbe662d629dd1bd3b4f6e@dist-git>
b971b8
From: Laine Stump <laine@redhat.com>
b971b8
Date: Sun, 26 Apr 2020 13:04:10 -0400
b971b8
Subject: [PATCH] conf: add new PCI_CONNECT flag AUTOASSIGN
b971b8
b971b8
This new flag will be set for any controller that we decide can have
b971b8
devices assigned to it automatically during PCI device assignment. In
b971b8
the past PCI_CONNECT_TYPE_HOTPLUGGABLE was used for this purpose, but
b971b8
that is overloading that flag, and no longer technically correct; what
b971b8
we *really* want is to auto-assign devices to any pcie-root-port or
b971b8
pcie-switch-downstream-port regardless of whether or not that
b971b8
controller happens to have hotplug enabled.
b971b8
b971b8
This patch just adds the flag, but doesn't use it at all. Note that
b971b8
the numbering of all the other flags was changed in order to insert
b971b8
the new flag near the beginning of the list; that doesn't cause any
b971b8
problem because the connect flags aren't stored anywhere between runs
b971b8
of libvirtd.
b971b8
b971b8
Signed-off-by: Laine Stump <laine@redhat.com>
b971b8
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
b971b8
(cherry picked from commit c296a846ad7de3066a17404f4f407d3e1b6d7935)
b971b8
b971b8
https://bugzilla.redhat.com/1802592
b971b8
Signed-off-by: Laine Stump <laine@redhat.com>
b971b8
Message-Id: <20200426170415.18328-8-laine@redhat.com>
b971b8
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
b971b8
---
b971b8
 src/conf/domain_addr.h | 41 +++++++++++++++++++++--------------------
b971b8
 1 file changed, 21 insertions(+), 20 deletions(-)
b971b8
b971b8
diff --git a/src/conf/domain_addr.h b/src/conf/domain_addr.h
b971b8
index dcb90618f8..40738ddb72 100644
b971b8
--- a/src/conf/domain_addr.h
b971b8
+++ b/src/conf/domain_addr.h
b971b8
@@ -32,26 +32,27 @@ typedef enum {
b971b8
 } virPCIDeviceAddressExtensionFlags;
b971b8
 
b971b8
 typedef enum {
b971b8
-   VIR_PCI_CONNECT_HOTPLUGGABLE = 1 << 0, /* is hotplug needed/supported */
b971b8
-
b971b8
-   /* set for devices that can share a single slot in auto-assignment
b971b8
-    * (by assigning one device to each of the 8 functions on the slot)
b971b8
-    */
b971b8
-   VIR_PCI_CONNECT_AGGREGATE_SLOT = 1 << 1,
b971b8
-
b971b8
-   /* kinds of devices as a bitmap so they can be combined (some PCI
b971b8
-    * controllers permit connecting multiple types of devices)
b971b8
-    */
b971b8
-   VIR_PCI_CONNECT_TYPE_PCI_DEVICE = 1 << 2,
b971b8
-   VIR_PCI_CONNECT_TYPE_PCIE_DEVICE = 1 << 3,
b971b8
-   VIR_PCI_CONNECT_TYPE_PCIE_ROOT_PORT = 1 << 4,
b971b8
-   VIR_PCI_CONNECT_TYPE_PCIE_SWITCH_UPSTREAM_PORT = 1 << 5,
b971b8
-   VIR_PCI_CONNECT_TYPE_PCIE_SWITCH_DOWNSTREAM_PORT = 1 << 6,
b971b8
-   VIR_PCI_CONNECT_TYPE_DMI_TO_PCI_BRIDGE = 1 << 7,
b971b8
-   VIR_PCI_CONNECT_TYPE_PCI_EXPANDER_BUS = 1 << 8,
b971b8
-   VIR_PCI_CONNECT_TYPE_PCIE_EXPANDER_BUS = 1 << 9,
b971b8
-   VIR_PCI_CONNECT_TYPE_PCI_BRIDGE = 1 << 10,
b971b8
-   VIR_PCI_CONNECT_TYPE_PCIE_TO_PCI_BRIDGE = 1 << 11,
b971b8
+    VIR_PCI_CONNECT_AUTOASSIGN = 1 << 0, /* okay to autoassign a device to this controller */
b971b8
+    VIR_PCI_CONNECT_HOTPLUGGABLE = 1 << 1, /* is hotplug needed/supported */
b971b8
+
b971b8
+    /* set for devices that can share a single slot in auto-assignment
b971b8
+     * (by assigning one device to each of the 8 functions on the slot)
b971b8
+     */
b971b8
+    VIR_PCI_CONNECT_AGGREGATE_SLOT = 1 << 2,
b971b8
+
b971b8
+    /* kinds of devices as a bitmap so they can be combined (some PCI
b971b8
+     * controllers permit connecting multiple types of devices)
b971b8
+     */
b971b8
+    VIR_PCI_CONNECT_TYPE_PCI_DEVICE = 1 << 3,
b971b8
+    VIR_PCI_CONNECT_TYPE_PCIE_DEVICE = 1 << 4,
b971b8
+    VIR_PCI_CONNECT_TYPE_PCIE_ROOT_PORT = 1 << 5,
b971b8
+    VIR_PCI_CONNECT_TYPE_PCIE_SWITCH_UPSTREAM_PORT = 1 << 6,
b971b8
+    VIR_PCI_CONNECT_TYPE_PCIE_SWITCH_DOWNSTREAM_PORT = 1 << 7,
b971b8
+    VIR_PCI_CONNECT_TYPE_DMI_TO_PCI_BRIDGE = 1 << 8,
b971b8
+    VIR_PCI_CONNECT_TYPE_PCI_EXPANDER_BUS = 1 << 9,
b971b8
+    VIR_PCI_CONNECT_TYPE_PCIE_EXPANDER_BUS = 1 << 10,
b971b8
+    VIR_PCI_CONNECT_TYPE_PCI_BRIDGE = 1 << 11,
b971b8
+    VIR_PCI_CONNECT_TYPE_PCIE_TO_PCI_BRIDGE = 1 << 12,
b971b8
 } virDomainPCIConnectFlags;
b971b8
 
b971b8
 /* a combination of all bits that describe the type of connections
b971b8
-- 
b971b8
2.26.2
b971b8