pci romfiles: add property, add default to PCIDeviceInfo

This patch adds a romfile property to the pci bus.  It allows to specify
a romfile to load into the rom bar of the pci device.  The default value
comes from a new field in PCIDeviceInfo.  The property allows to change
the file and also to disable the rom loading using an empty string.

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-12-18 12:01:08 +01:00 committed by Anthony Liguori
parent c2039bd0ff
commit 8c52c8f320
6 changed files with 29 additions and 32 deletions

View file

@ -518,14 +518,6 @@ static int virtio_net_init_pci(PCIDevice *pci_dev)
/* make the actual value visible */
proxy->nvectors = vdev->nvectors;
if (!pci_dev->qdev.hotplugged) {
static int loaded = 0;
if (!loaded) {
pci_add_option_rom(pci_dev, "pxe-virtio.bin");
loaded = 1;
}
}
return 0;
}
@ -569,6 +561,7 @@ static PCIDeviceInfo virtio_info[] = {
.qdev.size = sizeof(VirtIOPCIProxy),
.init = virtio_net_init_pci,
.exit = virtio_net_exit_pci,
.romfile = "pxe-virtio.bin",
.qdev.props = (Property[]) {
DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 3),
DEFINE_NIC_PROPERTIES(VirtIOPCIProxy, nic),