From: Mark McLoughlin <markmc@redhat.com>
To: Glauber Costa <glommer@redhat.com>
Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] allow for name property in pci devices.
Date: Thu, 18 Jun 2009 08:33:41 +0100 [thread overview]
Message-ID: <1245310421.675.41.camel@blaa> (raw)
In-Reply-To: <1245244380-27863-1-git-send-email-glommer@redhat.com>
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.
next prev parent reply other threads:[~2009-06-18 7:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2009-06-18 9:54 ` Gerd Hoffmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1245310421.675.41.camel@blaa \
--to=markmc@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=glommer@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.