diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2009-10-21 15:25:29 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-10-27 12:28:38 -0500 |
commit | dc7aff118b6ec245c227c9e630c8928bf2e093ec (patch) | |
tree | 767d892d589208636a06b26bef5b2caf4bc891a2 /hw/pci.c | |
parent | d8ed79aea7b89b1dc0dbd9ca0b05508e711d2c6d (diff) |
prepare pci nic init path for qdev property configuration.
Initialization path will work with both converted and not-converted
drivers, so we can convert drivers one by one.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/pci.c')
-rw-r--r-- | hw/pci.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -859,10 +859,16 @@ PCIDevice *pci_nic_init(NICInfo *nd, const char *default_model, dev = &pci_dev->qdev; if (nd->name) dev->id = qemu_strdup(nd->name); - dev->nd = nd; + if (qdev_prop_exists(dev, "mac")) { + /* qdev-ified */ + qdev_set_nic_properties(dev, nd); + } else { + /* legacy */ + dev->nd = nd; + nd->private = dev; + } if (qdev_init(dev) < 0) return NULL; - nd->private = dev; return pci_dev; } |