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

Re: [Xen-devel] [QEMU][RFC V2 06/10] xen-pci: register PCI device in Xen and handle IOREQ_TYPE_PCI_CONFIG



On 08/23/2012 03:41 PM, Stefano Stabellini wrote:
On Wed, 22 Aug 2012, Julien Grall wrote:
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<julien.grall@xxxxxxxxxx>
---
  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;
Is this an error condition? If so we should print an error message,
right?

Yes, it means that the BDF is already registered by another QEMU.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.