diff mbox

[v5,for-2.3,18/28] hw/pci: removed 'rootbus nr is 0' assumption from qmp_pci_query

Message ID 1426001534-7151-19-git-send-email-marcel@redhat.com
State New
Headers show

Commit Message

Marcel Apfelbaum March 10, 2015, 3:32 p.m. UTC
From: Marcel Apfelbaum <marcel.a@redhat.com>

Use the newer pci_bus_num to correctly get the root bus number.

Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
---
 hw/pci/pci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index e386f2c..53598bd 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -1266,7 +1266,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) {