All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] allow for name property in pci devices.
@ 2009-06-17 13:13 Glauber Costa
  2009-06-17 13:46 ` Paul Brook
  2009-06-18  7:33 ` Mark McLoughlin
  0 siblings, 2 replies; 4+ messages in thread
From: Glauber Costa @ 2009-06-17 13:13 UTC (permalink / raw)
  To: qemu-devel; +Cc: aliguori

not all devices should be called "FIXME".

Signed-off-by: Glauber Costa <glommer@redhat.com>
---
 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);
     assert(pci_dev);
     info->init(pci_dev);
@@ -943,6 +947,7 @@ PCIDevice *pci_create_simple(PCIBus *bus, int devfn, const char *name)
 
     dev = qdev_create(&bus->qbus, name);
     qdev_set_prop_int(dev, "devfn", devfn);
+    qdev_set_prop_ptr(dev, "name", (void *)name);
     qdev_init(dev);
 
     return (PCIDevice *)dev;
-- 
1.6.2.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] allow for name property in pci devices.
  2009-06-17 13:13 [Qemu-devel] [PATCH] allow for name property in pci devices Glauber Costa
@ 2009-06-17 13:46 ` Paul Brook
  2009-06-18  7:33 ` Mark McLoughlin
  1 sibling, 0 replies; 4+ messages in thread
From: Paul Brook @ 2009-06-17 13:46 UTC (permalink / raw)
  To: qemu-devel; +Cc: Glauber Costa, aliguori

On Wednesday 17 June 2009, Glauber Costa wrote:
> not all devices should be called "FIXME".

Maybe not, but I don't think this is a user specified field either.

Paul

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] allow for name property in pci devices.
  2009-06-17 13:13 [Qemu-devel] [PATCH] allow for name property in pci devices Glauber Costa
  2009-06-17 13:46 ` Paul Brook
@ 2009-06-18  7:33 ` Mark McLoughlin
  2009-06-18  9:54   ` Gerd Hoffmann
  1 sibling, 1 reply; 4+ messages in thread
From: Mark McLoughlin @ 2009-06-18  7:33 UTC (permalink / raw)
  To: Glauber Costa; +Cc: aliguori, qemu-devel

On Wed, 2009-06-17 at 09:13 -0400, Glauber Costa wrote:
> not all devices should be called "FIXME".
> 
> Signed-off-by: Glauber Costa <glommer@redhat.com>
> ---
>  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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] allow for name property in pci devices.
  2009-06-18  7:33 ` Mark McLoughlin
@ 2009-06-18  9:54   ` Gerd Hoffmann
  0 siblings, 0 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2009-06-18  9:54 UTC (permalink / raw)
  To: Mark McLoughlin; +Cc: Glauber Costa, aliguori, qemu-devel

On 06/18/09 09:33, Mark McLoughlin wrote:
>> -    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?

+1

While we are at it:  Do we need the name field in PCIDevice the first 
place then?  Well, maybe better keep it until all pci devices are moved 
over to qdev.

cheers,
   Gerd

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-06-18  9:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-17 13:13 [Qemu-devel] [PATCH] allow for name property in pci devices Glauber Costa
2009-06-17 13:46 ` Paul Brook
2009-06-18  7:33 ` Mark McLoughlin
2009-06-18  9:54   ` Gerd Hoffmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.