From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60193) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SeSon-0006yh-Dc for qemu-devel@nongnu.org; Tue, 12 Jun 2012 11:15:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SeSoi-0003GD-1A for qemu-devel@nongnu.org; Tue, 12 Jun 2012 11:15:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38784) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SeSoh-0003Fd-Pb for qemu-devel@nongnu.org; Tue, 12 Jun 2012 11:15:35 -0400 Date: Tue, 12 Jun 2012 18:15:57 +0300 From: "Michael S. Tsirkin" Message-ID: <20120612151557.GA10691@redhat.com> References: <1339513523-1699-1-git-send-email-anthony.perard@citrix.com> <1339513523-1699-6-git-send-email-anthony.perard@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1339513523-1699-6-git-send-email-anthony.perard@citrix.com> Subject: Re: [Qemu-devel] [PATCH V12 5/9] Revert "pci: don't export an internal function" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony PERARD Cc: Anthony Liguori , Stefano Stabellini , QEMU-devel , Xen Devel On Tue, Jun 12, 2012 at 04:05:19PM +0100, Anthony PERARD wrote: > This reverts commit 94a09e2c846374a96719cda2b4e1312d8c4b08a7. > > This function is used by a later patch to parse the BDF of the device to > passthrough. > > Signed-off-by: Anthony PERARD You probably want to parse the host address? You don't want to copy the bugs in pci_parse_devaddr - write your own that has sane semantics for host. E.g. you need to support ARI etc. > --- > hw/pci.c | 2 +- > hw/pci.h | 2 ++ > 2 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/hw/pci.c b/hw/pci.c > index eec106a..5bddf7a 100644 > --- a/hw/pci.c > +++ b/hw/pci.c > @@ -479,7 +479,7 @@ static void pci_set_default_subsystem_id(PCIDevice *pci_dev) > * Parse [[:]:], return -1 on error if funcp == NULL > * [[:]:]., return -1 on error > */ > -static int pci_parse_devaddr(const char *addr, int *domp, int *busp, > +int pci_parse_devaddr(const char *addr, int *domp, int *busp, > unsigned int *slotp, unsigned int *funcp) > { > const char *p; > diff --git a/hw/pci.h b/hw/pci.h > index ecf37fd..b169c0b 100644 > --- a/hw/pci.h > +++ b/hw/pci.h > @@ -321,6 +321,8 @@ PCIDevice *pci_find_device(PCIBus *bus, int bus_num, uint8_t devfn); > int pci_qdev_find_device(const char *id, PCIDevice **pdev); > PCIBus *pci_get_bus_devfn(int *devfnp, const char *devaddr); > > +int pci_parse_devaddr(const char *addr, int *domp, int *busp, > + unsigned int *slotp, unsigned int *funcp); > int pci_read_devaddr(Monitor *mon, const char *addr, int *domp, int *busp, > unsigned *slotp); > > -- > Anthony PERARD