summary refs log tree commit diff stats
path: root/hw/virtio-pci.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2009-12-18 12:01:08 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2009-12-18 11:26:34 -0600
commit8c52c8f320b27684ec3b1a649925b75af376b1f7 (patch)
tree3319fe6f7e835d0a718000ae04be89f380d72406 /hw/virtio-pci.c
parentc2039bd0ffce8807e0eaac55254fde790825fa92 (diff)
downloadfocaccia-qemu-8c52c8f320b27684ec3b1a649925b75af376b1f7.tar.gz
focaccia-qemu-8c52c8f320b27684ec3b1a649925b75af376b1f7.zip
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>
Diffstat (limited to 'hw/virtio-pci.c')
-rw-r--r--hw/virtio-pci.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index 85f14a2c23..62b46bd484 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -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),