aboutsummaryrefslogtreecommitdiff
path: root/hw/pci
diff options
context:
space:
mode:
authorMarcel Apfelbaum <marcel.a@redhat.com>2015-06-02 14:23:05 +0300
committerMichael S. Tsirkin <mst@redhat.com>2015-06-03 18:19:17 +0200
commitcb2ed8b3c66284f226c523231e2c09e60bbb34bb (patch)
treee2670b51fc4735df43b3d4b190cade2fa26d7766 /hw/pci
parentdcdca29655f774568f30a82b7fe0190b4bd38802 (diff)
hw/pci: removed 'rootbus nr is 0' assumption from qmp_pci_query
Use the newer pci_bus_num to correctly get the root bus number. Signed-off-by: Marcel Apfelbaum <marcel@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'hw/pci')
-rw-r--r--hw/pci/pci.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 3361d85056..a95664092e 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -1594,7 +1594,8 @@ PciInfoList *qmp_query_pci(Error **errp)
QLIST_FOREACH(host_bridge, &pci_host_bridges, next) {
info = g_malloc0(sizeof(*info));
- info->value = qmp_query_pci_bus(host_bridge->bus, 0);
+ info->value = qmp_query_pci_bus(host_bridge->bus,
+ pci_bus_num(host_bridge->bus));
/* XXX: waiting for the qapi to support GSList */
if (!cur_item) {