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>
This commit is contained in:
		
							parent
							
								
									dcdca29655
								
							
						
					
					
						commit
						cb2ed8b3c6
					
				@ -1594,7 +1594,8 @@ PciInfoList *qmp_query_pci(Error **errp)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    QLIST_FOREACH(host_bridge, &pci_host_bridges, next) {
 | 
					    QLIST_FOREACH(host_bridge, &pci_host_bridges, next) {
 | 
				
			||||||
        info = g_malloc0(sizeof(*info));
 | 
					        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 */
 | 
					        /* XXX: waiting for the qapi to support GSList */
 | 
				
			||||||
        if (!cur_item) {
 | 
					        if (!cur_item) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user