summaryrefslogtreecommitdiff
path: root/hw/pci-hotplug.c
diff options
context:
space:
mode:
authorIsaku Yamahata <yamahata@valinux.co.jp>2009-10-30 21:21:13 +0900
committerAnthony Liguori <aliguori@us.ibm.com>2009-11-09 08:43:09 -0600
commite822a52a81f16e09b59cfd8126786bff6bde98bd (patch)
treed22caf5f16ac54efb8e9d08e9544221822c03c91 /hw/pci-hotplug.c
parente94ff650263d99006fcfa857a72e5e1dd9638720 (diff)
downloadqemu-e822a52a81f16e09b59cfd8126786bff6bde98bd.tar.gz
pci: make pci configuration transaction more accurate.
This patch sorts out/enhances pci code to track pci bus topology more accurately. - Track host bus bridge with pci domain number. Although the current qemu implementation supports only pci domian 0 yet. - Track pci bridge parent-child relationship. When looking down from pci host bus for pci sub bus, be aware of secondary bus/subordinate bus. Thus pci configuration transaction is more accurately emulated. This patch adds new member to PCIBus to track pci bus topology. Since qdev already tracks down bus relationship, those new member wouldn't be necessary. However it would be addressed later because not all the pci device isn't converted to qdev yet. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/pci-hotplug.c')
-rw-r--r--hw/pci-hotplug.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c
index cea840993e..a254498143 100644
--- a/hw/pci-hotplug.c
+++ b/hw/pci-hotplug.c
@@ -113,7 +113,7 @@ void drive_hot_add(Monitor *mon, const QDict *qdict)
if (pci_read_devaddr(mon, pci_addr, &dom, &pci_bus, &slot)) {
goto err;
}
- dev = pci_find_device(pci_bus, slot, 0);
+ dev = pci_find_device(pci_find_host_bus(0), pci_bus, slot, 0);
if (!dev) {
monitor_printf(mon, "no pci device with address %s\n", pci_addr);
goto err;
@@ -257,7 +257,7 @@ void pci_device_hot_remove(Monitor *mon, const char *pci_addr)
return;
}
- d = pci_find_device(bus, slot, 0);
+ d = pci_find_device(pci_find_host_bus(0), bus, slot, 0);
if (!d) {
monitor_printf(mon, "slot %d empty\n", slot);
return;