From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52623) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4tTA-00079A-39 for qemu-devel@nongnu.org; Fri, 24 Aug 2012 08:58:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T4tT4-0006Lw-9G for qemu-devel@nongnu.org; Fri, 24 Aug 2012 08:58:36 -0400 Received: from smtp.citrix.com ([66.165.176.89]:48733) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4tT4-0006Ls-4G for qemu-devel@nongnu.org; Fri, 24 Aug 2012 08:58:30 -0400 Message-ID: <50377A9C.7090500@citrix.com> Date: Fri, 24 Aug 2012 13:59:08 +0100 From: Julien Grall MIME-Version: 1.0 References: <10985f0bc427cc258adb11cb97818a4e7ab133c9.1345637459.git.julien.grall@citrix.com> In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [QEMU][RFC V2 06/10] xen-pci: register PCI device in Xen and handle IOREQ_TYPE_PCI_CONFIG List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefano Stabellini Cc: "christian.limpach@gmail.com" , "qemu-devel@nongnu.org" , "xen-devel@lists.xen.org" 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 >> --- >> 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.