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:
parent
d8ed79aea7
commit
dc7aff118b
10
hw/pci.c
10
hw/pci.c
@ -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);
|
||||||
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)
|
if (qdev_init(dev) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
nd->private = dev;
|
|
||||||
return pci_dev;
|
return pci_dev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user