[libvirt PATCH] conf: Allow conventional PCI devices to be marked as integrated

Andrea Bolognani posted 1 patch 1 year, 2 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20230209180024.927314-1-abologna@redhat.com
src/conf/domain_addr.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
[libvirt PATCH] conf: Allow conventional PCI devices to be marked as integrated
Posted by Andrea Bolognani 1 year, 2 months ago
Integrated PCI devices can be either PCIe (virtio-iommu) or
conventional PCI (pvpanic-pci). Right now libvirt will refuse
to assign an address on pcie.0 for the latter, but that's an
undesirable limitation that we can easily remove.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
 src/conf/domain_addr.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c
index 76f9c12ca6..b6534f502c 100644
--- a/src/conf/domain_addr.c
+++ b/src/conf/domain_addr.c
@@ -306,8 +306,11 @@ virDomainPCIAddressFlagsCompatible(virPCIDeviceAddress *addr,
         if (addr->bus == 0) {
             /* pcie-root doesn't usually allow endpoint devices to be
              * plugged directly into it, but for integrated devices
-             * that's exactly what we want */
-            busFlags |= VIR_PCI_CONNECT_AUTOASSIGN;
+             * that's exactly what we want. It also refuses conventional
+             * PCI devices by default, but in the case of integrated
+             * devices both types are fine */
+            busFlags |= VIR_PCI_CONNECT_TYPE_PCI_DEVICE |
+                        VIR_PCI_CONNECT_AUTOASSIGN;
         } else {
             if (reportError) {
                 virReportError(errType,
-- 
2.39.1
Re: [libvirt PATCH] conf: Allow conventional PCI devices to be marked as integrated
Posted by Michal Prívozník 1 year, 2 months ago
On 2/9/23 19:00, Andrea Bolognani wrote:
> Integrated PCI devices can be either PCIe (virtio-iommu) or
> conventional PCI (pvpanic-pci). Right now libvirt will refuse
> to assign an address on pcie.0 for the latter, but that's an
> undesirable limitation that we can easily remove.
> 
> Signed-off-by: Andrea Bolognani <abologna@redhat.com>
> ---
>  src/conf/domain_addr.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

Michal