From e822a52a81f16e09b59cfd8126786bff6bde98bd Mon Sep 17 00:00:00 2001 From: Isaku Yamahata Date: Fri, 30 Oct 2009 21:21:13 +0900 Subject: 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 Signed-off-by: Anthony Liguori --- hw/pci-hotplug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'hw/pci-hotplug.c') diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c index cea8409..a254498 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; -- cgit v1.1