qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [QEMU][RFC V2 06/10] xen-pci: register PCI device in Xe


From: Julien Grall
Subject: Re: [Qemu-devel] [QEMU][RFC V2 06/10] xen-pci: register PCI device in Xen and handle IOREQ_TYPE_PCI_CONFIG
Date: Fri, 24 Aug 2012 13:59:08 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.16) Gecko/20120726 Icedove/3.0.11

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<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;
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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]