[PATCH] qemu_command.c: allow hostdev to be attached to PCIe bus

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

 



Presently attaching a host device to the pcie-root controller fails, even if
the host device is actually a PCIe device.  With this change, the attachment
succeeds, QEMU is happy, and the guest correctly sees the host device as a
child of the PCIe root.
---
 src/qemu/qemu_command.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 4d1590c..1de89e3 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1377,6 +1377,13 @@ qemuCollectPCIAddress(virDomainDefPtr def ATTRIBUTE_UNUSED,
          */
         flags = VIR_PCI_CONNECT_TYPE_PCI | VIR_PCI_CONNECT_TYPE_PCIE;
         break;
+
+    case VIR_DOMAIN_DEVICE_HOSTDEV:
+        /* hostdev aren't hot-plugged, and can be put in either a
+         * PCI or PCIe slot
+         */
+        flags = VIR_PCI_CONNECT_TYPE_PCI | VIR_PCI_CONNECT_TYPE_PCIE;
+        break;
     }
 
     /* Ignore implicit controllers on slot 0:0:1.0:
-- 
2.1.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[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]