All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: Mark McLoughlin <markmc@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] Do we still need the hack to set qdev id from NICInfo.name?
Date: Tue, 08 Jun 2010 10:57:52 +0200	[thread overview]
Message-ID: <m3mxv5q4tr.fsf@blackfin.pond.sub.org> (raw)

In pci_nic_init():

    pci_dev = pci_create(bus, devfn, pci_nic_names[i]);
    dev = &pci_dev->qdev;
    if (nd->name)
        dev->id = qemu_strdup(nd->name);

Blatant violation of the DeviceState abstraction.  Which even carries a
comment advising against this:

/* This structure should not be accessed directly.  We declare it here
   so that it can be embedded in individual device state structures.  */
struct DeviceState {

Do we still need this?  Anybody wanting ID can use -device.


History: it was added in commit eb54b6dc
Author: Gerd Hoffmann <kraxel@redhat.com>
Date:   Wed Jul 15 13:43:35 2009 +0200

    qdev: add id= support for pci nics.

and modified to use existing name instead of new id in commit dea7b3b9
Author: Mark McLoughlin <markmc@redhat.com>
Date:   Thu Oct 8 19:58:22 2009 +0100

    net: remove id field from NICInfo
    
    Just use the name field instead since we now use the id paramater as
    the name, if supplied. Only implication with this change is that if
    id is not supplied, the value of the name paramater is used as an
    id.

             reply	other threads:[~2010-06-08  8:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-08  8:57 Markus Armbruster [this message]
2010-06-08  9:03 ` [Qemu-devel] Re: Do we still need the hack to set qdev id from NICInfo.name? 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=m3mxv5q4tr.fsf@blackfin.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=markmc@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.