aboutsummaryrefslogtreecommitdiff
path: root/hw/pci.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2009-10-21 15:25:29 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-10-27 12:28:38 -0500
commitdc7aff118b6ec245c227c9e630c8928bf2e093ec (patch)
tree767d892d589208636a06b26bef5b2caf4bc891a2 /hw/pci.c
parentd8ed79aea7b89b1dc0dbd9ca0b05508e711d2c6d (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.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/hw/pci.c b/hw/pci.c
index abf07cabd0..fe2c4bd3d3 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -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;
}