With QEMU disaggregation QEMU needs to specify which PCI device it's able to
handle. It will use the device place in the topology (domain, bus, device,
function).
When Xen will trap an access for the config space, it will forge a new
ioreq and forward it to the right QEMU.
Signed-off-by: Julien Grall<address@hidden>
---
hw/pci.c | 6 ++++++
hw/xen.h | 1 +
xen-all.c | 38 ++++++++++++++++++++++++++++++++++++++
xen-stub.c | 5 +++++
4 files changed, 50 insertions(+), 0 deletions(-)
diff --git a/hw/pci.c b/hw/pci.c
index 4d95984..0112edf 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -33,6 +33,7 @@
#include "qmp-commands.h"
#include "msi.h"
#include "msix.h"
+#include "xen.h"
//#define DEBUG_PCI
#ifdef DEBUG_PCI
@@ -781,6 +782,11 @@ static PCIDevice *do_pci_register_device(PCIDevice
*pci_dev, PCIBus *bus,
pci_dev->devfn = devfn;
pstrcpy(pci_dev->name, sizeof(pci_dev->name), name);
pci_dev->irq_state = 0;
+
+ if (xen_enabled()&& xen_register_pcidev(pci_dev)) {
+ return NULL;