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 <address@hidden>
---
hw/cirrus_vga.c | 4 +---
hw/e1000.c | 9 +--------
hw/pci.c | 24 +++++++++++++++++++++---
hw/pci.h | 6 ++++--
hw/rtl8139.c | 9 +--------
hw/virtio-pci.c | 9 +--------
6 files changed, 29 insertions(+), 32 deletions(-)
diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index b08d2ae..6fe433d 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -3209,9 +3209,6 @@ static int pci_cirrus_vga_initfn(PCIDevice *dev)
pci_register_bar((PCIDevice *)d, 1, CIRRUS_PNPMMIO_SIZE,
PCI_BASE_ADDRESS_SPACE_MEMORY, cirrus_pci_mmio_map);
}
-
- /* ROM BIOS */
- pci_add_option_rom((PCIDevice *)d, VGABIOS_CIRRUS_FILENAME);
return 0;
}
@@ -3226,6 +3223,7 @@ static PCIDeviceInfo cirrus_vga_info = {
.qdev.size = sizeof(PCICirrusVGAState),
.qdev.vmsd = &vmstate_pci_cirrus_vga,
.init = pci_cirrus_vga_initfn,
+ .romfile = VGABIOS_CIRRUS_FILENAME,
.config_write = pci_cirrus_write_config,
};