From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MHC8N-0001zS-G4 for qemu-devel@nongnu.org; Thu, 18 Jun 2009 03:34:07 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MHC8I-0001zF-8O for qemu-devel@nongnu.org; Thu, 18 Jun 2009 03:34:07 -0400 Received: from [199.232.76.173] (port=58780 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MHC8I-0001zC-5R for qemu-devel@nongnu.org; Thu, 18 Jun 2009 03:34:02 -0400 Received: from mx2.redhat.com ([66.187.237.31]:41026) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MHC8H-0002kB-Lm for qemu-devel@nongnu.org; Thu, 18 Jun 2009 03:34:01 -0400 Subject: Re: [Qemu-devel] [PATCH] allow for name property in pci devices. From: Mark McLoughlin In-Reply-To: <1245244380-27863-1-git-send-email-glommer@redhat.com> References: <1245244380-27863-1-git-send-email-glommer@redhat.com> Content-Type: text/plain Date: Thu, 18 Jun 2009 08:33:41 +0100 Message-Id: <1245310421.675.41.camel@blaa> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Reply-To: Mark McLoughlin List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Glauber Costa Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org On Wed, 2009-06-17 at 09:13 -0400, Glauber Costa wrote: > not all devices should be called "FIXME". > > Signed-off-by: Glauber Costa > --- > hw/pci.c | 7 ++++++- > 1 files changed, 6 insertions(+), 1 deletions(-) > > diff --git a/hw/pci.c b/hw/pci.c > index 0ab5b94..baffadd 100644 > --- a/hw/pci.c > +++ b/hw/pci.c > @@ -827,6 +827,7 @@ PCIDevice *pci_nic_init(PCIBus *bus, NICInfo *nd, int devfn, > if (strcmp(nd->model, pci_nic_models[i]) == 0) { > dev = qdev_create(&bus->qbus, pci_nic_names[i]); > qdev_set_prop_int(dev, "devfn", devfn); > + qdev_set_prop_ptr(dev, "name", (void *)pci_nic_names[i]); > qdev_set_netdev(dev, nd); > qdev_init(dev); > nd->private = dev; > @@ -916,10 +917,13 @@ static void pci_qdev_init(DeviceState *qdev, DeviceInfo *base) > PCIDeviceInfo *info = container_of(base, PCIDeviceInfo, qdev); > PCIBus *bus; > int devfn; > + void *name; > > bus = FROM_QBUS(PCIBus, qdev_get_parent_bus(qdev)); > devfn = qdev_get_prop_int(qdev, "devfn", -1); > - pci_dev = do_pci_register_device(pci_dev, bus, "FIXME", devfn, > + name = qdev_get_prop_ptr(qdev, "name"); > + > + pci_dev = do_pci_register_device(pci_dev, bus, name, devfn, > NULL, NULL);//FIXME:config_read, config_write); Why not just use base->name here? Cheers, Mark.