qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Do we still need the hack to set qdev id from NICInfo.name?


From: Markus Armbruster
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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

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 <address@hidden>
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 <address@hidden>
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 via email to

[Prev in Thread] Current Thread [Next in Thread]