libvirt/SOURCES/libvirt-conf-add-new-PCI_CONNECT-flag-AUTOASSIGN.patch
2021-09-10 11:58:15 +00:00

88 lines
3.8 KiB
Diff

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