From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=38567 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ORnzY-0007fq-JN for qemu-devel@nongnu.org; Thu, 24 Jun 2010 11:05:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ORnzX-0005An-7X for qemu-devel@nongnu.org; Thu, 24 Jun 2010 11:05:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55226) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ORnzW-0005Ab-TP for qemu-devel@nongnu.org; Thu, 24 Jun 2010 11:05:23 -0400 Subject: Re: [Qemu-devel] [PATCH 03/15] pci: Implement BusInfo.get_dev_path() From: Alex Williamson In-Reply-To: <20100624073901.GC4498@valinux.co.jp> References: <20100624044046.16168.32804.stgit@localhost.localdomain> <20100624044112.16168.70618.stgit@localhost.localdomain> <20100624073901.GC4498@valinux.co.jp> Content-Type: text/plain; charset="UTF-8" Date: Thu, 24 Jun 2010 09:05:11 -0600 Message-ID: <1277391911.4669.2252.camel@x201> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Isaku Yamahata Cc: jan.kiszka@siemens.com, qemu-devel@nongnu.org, armbru@redhat.com, paul@codesourcery.com, cam@cs.ualberta.ca, kraxel@redhat.com On Thu, 2010-06-24 at 16:39 +0900, Isaku Yamahata wrote: > On Wed, Jun 23, 2010 at 10:41:13PM -0600, Alex Williamson wrote: > > This works great for PCI since a ::. uniquely > > describes a global address. No need to traverse up the qdev tree. > > PCI segment support is a placeholder for compatibility once we > > support multiple segments. > > > > Signed-off-by: Alex Williamson > > --- > > > > hw/pci.c | 14 ++++++++++++++ > > 1 files changed, 14 insertions(+), 0 deletions(-) > > > > diff --git a/hw/pci.c b/hw/pci.c > > index 7787005..5c9d6b4 100644 > > --- a/hw/pci.c > > +++ b/hw/pci.c > > @@ -58,11 +58,13 @@ struct PCIBus { > > }; > > > > static void pcibus_dev_print(Monitor *mon, DeviceState *dev, int indent); > > +static char *pcibus_get_dev_path(DeviceState *dev); > > > > static struct BusInfo pci_bus_info = { > > .name = "PCI", > > .size = sizeof(PCIBus), > > .print_dev = pcibus_dev_print, > > + .get_dev_path = pcibus_get_dev_path, > > .props = (Property[]) { > > DEFINE_PROP_PCI_DEVFN("addr", PCIDevice, devfn, -1), > > DEFINE_PROP_STRING("romfile", PCIDevice, romfile), > > @@ -1853,6 +1855,18 @@ static void pcibus_dev_print(Monitor *mon, DeviceState *dev, int indent) > > } > > } > > > > +static char *pcibus_get_dev_path(DeviceState *dev) > > +{ > > + PCIDevice *d = (PCIDevice *)dev; > > + char path[16]; > > + > > + snprintf(path, sizeof(path), "%04x:%02x:%02x.%x", > > + 0 /* FIXME for segment support */, d->config[PCI_SECONDARY_BUS], > > pci_find_domain(d->bus) Thank you Isaku, I'll make the change. Alex