]> git.proxmox.com Git - mirror_qemu.git/commitdiff
hw/pci: removed 'rootbus nr is 0' assumption from qmp_pci_query
authorMarcel Apfelbaum <marcel.a@redhat.com>
Tue, 2 Jun 2015 11:23:05 +0000 (14:23 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 3 Jun 2015 16:19:17 +0000 (18:19 +0200)
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>
hw/pci/pci.c

index 3361d850563d357acae257d8c9418b0fe29c765a..a95664092e0beb5803d4647b879eb7271b5c4fc6 100644 (file)
@@ -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) {