From: Glauber Costa <glommer@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] replace duplicated code.
Date: Thu, 18 Jun 2009 10:59:50 -0300 [thread overview]
Message-ID: <20090618135950.GF3517@poweredge.glommer> (raw)
In-Reply-To: <4A3A0D6C.9080002@redhat.com>
On Thu, Jun 18, 2009 at 11:48:28AM +0200, Gerd Hoffmann wrote:
>> - 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);
>
>> + d = pci_create_simple(bus, devfn, pci_nic_names[i]);
>> + qdev_set_netdev((DeviceState *)d, nd);
>
> You have changed the ordering of the qdev_set_netdev and qdev_init
> calls. I don't think this is correct, the init callback will not see
> the nicinfo then.
I see.
How would you feel about changing the nd field of qdev for a void * one,
call it private, or whatever?
then we could have a generic qdev_set_private(dev, p), that does it for
everybody. I must say I kinda dislike that specific dependency on nd for
net devices. Ideally, all devices should be treated as the same.
next prev parent reply other threads:[~2009-06-18 13:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-17 22:52 [Qemu-devel] [PATCH] replace duplicated code Glauber Costa
2009-06-18 7:39 ` Mark McLoughlin
2009-06-18 9:48 ` Gerd Hoffmann
2009-06-18 13:59 ` Glauber Costa [this message]
2009-06-18 14:33 ` 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=20090618135950.GF3517@poweredge.glommer \
--to=glommer@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=kraxel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).