summary refs log tree commit diff stats
path: root/hw/pci.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2012-06-26 15:05:33 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2012-06-26 15:05:33 -0500
commit7a542b67b32742ff5fe286f819df891d1df7bf56 (patch)
treecc85c3d9c0c381ae32178616c5956879cd554cb4 /hw/pci.c
parentb1a6609e754330c657a057a96322e574c129bc29 (diff)
parent3854ca577dad92c4fe97b4a6ebce360e25407af7 (diff)
downloadfocaccia-qemu-7a542b67b32742ff5fe286f819df891d1df7bf56.tar.gz
focaccia-qemu-7a542b67b32742ff5fe286f819df891d1df7bf56.zip
Merge remote-tracking branch 'sstabellini/xen-pt' into staging
* sstabellini/xen-pt:
  Introduce Xen PCI Passthrough, MSI
  Introduce apic-msidef.h
  Introduce Xen PCI Passthrough, PCI config space helpers
  Introduce Xen PCI Passthrough, qdevice
  qdev-properties: Introduce pci-host-devaddr.
  pci.c: Add opaque argument to pci_for_each_device.
  Introduce XenHostPCIDevice to access a pci device on the host.
  configure: Introduce --enable-xen-pci-passthrough.
  pci_ids: Add INTEL_82599_SFP_VF id.
Diffstat (limited to 'hw/pci.c')
-rw-r--r--hw/pci.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/hw/pci.c b/hw/pci.c
index bdfb3d6540..5c75f16781 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -1144,7 +1144,9 @@ static const pci_class_desc pci_class_descriptions[] =
 };
 
 static void pci_for_each_device_under_bus(PCIBus *bus,
-                                          void (*fn)(PCIBus *b, PCIDevice *d))
+                                          void (*fn)(PCIBus *b, PCIDevice *d,
+                                                     void *opaque),
+                                          void *opaque)
 {
     PCIDevice *d;
     int devfn;
@@ -1152,18 +1154,19 @@ static void pci_for_each_device_under_bus(PCIBus *bus,
     for(devfn = 0; devfn < ARRAY_SIZE(bus->devices); devfn++) {
         d = bus->devices[devfn];
         if (d) {
-            fn(bus, d);
+            fn(bus, d, opaque);
         }
     }
 }
 
 void pci_for_each_device(PCIBus *bus, int bus_num,
-                         void (*fn)(PCIBus *b, PCIDevice *d))
+                         void (*fn)(PCIBus *b, PCIDevice *d, void *opaque),
+                         void *opaque)
 {
     bus = pci_find_bus_nr(bus, bus_num);
 
     if (bus) {
-        pci_for_each_device_under_bus(bus, fn);
+        pci_for_each_device_under_bus(bus, fn, opaque);
     }
 }