summaryrefslogtreecommitdiff
path: root/hw/pci-hotplug.c
diff options
context:
space:
mode:
authorIsaku Yamahata <yamahata@valinux.co.jp>2010-05-28 18:30:46 +0900
committerMichael S. Tsirkin <mst@redhat.com>2010-05-31 16:39:55 +0300
commite075e788c9e882f5bebfb350f725ee7e4273033f (patch)
treecee279dff54e91932b3915f702324fd55e6630e9 /hw/pci-hotplug.c
parent1b4e8f732d118d1bd64c49e3c9d90832f8214272 (diff)
downloadqemu-e075e788c9e882f5bebfb350f725ee7e4273033f.tar.gz
pci-hotplug: make them aware of pci domain.
add helper function which converts root bus to pci domain. make them aware of pci domain. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/pci-hotplug.c')
-rw-r--r--hw/pci-hotplug.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c
index 37ac015f7d..a8f3df1701 100644
--- a/hw/pci-hotplug.c
+++ b/hw/pci-hotplug.c
@@ -124,7 +124,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_find_root_bus(0), pci_bus, slot, 0);
+ dev = pci_find_device(pci_find_root_bus(dom), pci_bus, slot, 0);
if (!dev) {
monitor_printf(mon, "no pci device with address %s\n", pci_addr);
goto err;
@@ -252,7 +252,8 @@ void pci_device_hot_add(Monitor *mon, const QDict *qdict)
if (dev) {
monitor_printf(mon, "OK domain %d, bus %d, slot %d, function %d\n",
- 0, pci_bus_num(dev->bus), PCI_SLOT(dev->devfn),
+ pci_find_domain(dev->bus),
+ pci_bus_num(dev->bus), PCI_SLOT(dev->devfn),
PCI_FUNC(dev->devfn));
} else
monitor_printf(mon, "failed to add %s\n", opts);
@@ -269,7 +270,7 @@ int pci_device_hot_remove(Monitor *mon, const char *pci_addr)
return -1;
}
- d = pci_find_device(pci_find_root_bus(0), bus, slot, 0);
+ d = pci_find_device(pci_find_root_bus(dom), bus, slot, 0);
if (!d) {
monitor_printf(mon, "slot %d empty\n", slot);
return -1;