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>
This commit is contained in:
Gerd Hoffmann 2009-10-21 15:25:29 +02:00 committed by Anthony Liguori
parent d8ed79aea7
commit dc7aff118b

View File

@ -859,10 +859,16 @@ PCIDevice *pci_nic_init(NICInfo *nd, const char *default_model,
dev = &pci_dev->qdev; dev = &pci_dev->qdev;
if (nd->name) if (nd->name)
dev->id = qemu_strdup(nd->name); dev->id = qemu_strdup(nd->name);
if (qdev_prop_exists(dev, "mac")) {
/* qdev-ified */
qdev_set_nic_properties(dev, nd);
} else {
/* legacy */
dev->nd = nd; dev->nd = nd;
nd->private = dev;
}
if (qdev_init(dev) < 0) if (qdev_init(dev) < 0)
return NULL; return NULL;
nd->private = dev;
return pci_dev; return pci_dev;
} }