summaryrefslogtreecommitdiffstats
path: root/hw/pci
diff options
context:
space:
mode:
authorDavid Gibson2017-11-29 09:46:26 +0100
committerMichael S. Tsirkin2017-12-05 18:13:45 +0100
commitcdc57472dcc2ddc440545bde26791a11b42232b6 (patch)
treed34a294183491d58915f9004d2b5c058216dda06 /hw/pci
parentpci: Move bridge data structures from pci_bus.h to pci_bridge.h (diff)
downloadqemu-cdc57472dcc2ddc440545bde26791a11b42232b6.tar.gz
qemu-cdc57472dcc2ddc440545bde26791a11b42232b6.tar.xz
qemu-cdc57472dcc2ddc440545bde26791a11b42232b6.zip
pci: Add pci_dev_bus_num() helper
A fair proportion of the users of pci_bus_num() want to get the bus number on a specific device, so first have to look up the bus from the device then call it. This adds a helper to do that (since we're going to make looking up the bus slightly more verbose). Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'hw/pci')
-rw-r--r--hw/pci/pcie_aer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/pci/pcie_aer.c b/hw/pci/pcie_aer.c
index 97200742b4..21f896aadd 100644
--- a/hw/pci/pcie_aer.c
+++ b/hw/pci/pcie_aer.c
@@ -1025,7 +1025,7 @@ static int do_pcie_aer_inject_error(Monitor *mon,
}
details->id = id;
details->root_bus = pci_root_bus_path(dev);
- details->bus = pci_bus_num(dev->bus);
+ details->bus = pci_dev_bus_num(dev);
details->devfn = dev->devfn;
return 0;