On 03/19/2015 01:42 PM, Steven Walter wrote:
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:
When adding support for the PCIE controller, I explicitly blocked this
because there wasn't concrete information on what was and wasn't
supported by qemu (as opposed to just currently working by fluke of
fate). Before we push anything like this, we should have an updated
discussion with qemu people to verify what can be connected to who, and
whether or not hot-plug is supported, and maybe try to do something a
bit more comprehensive.