From 3f84865ade594a2ec1ef613ab5fd11949f3d49de Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Fri, 25 Sep 2009 21:42:45 +0200 Subject: pci: windup acpi-based hotplug Switch over acpi-based PCI hotplug for pc over to the new qdev-based pci hotplugging. Signed-off-by: Gerd Hoffmann Signed-off-by: Anthony Liguori --- hw/pci-hotplug.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'hw/pci-hotplug.c') diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c index 7e39bddd65..990ab3b1c3 100644 --- a/hw/pci-hotplug.c +++ b/hw/pci-hotplug.c @@ -185,8 +185,6 @@ void pci_device_hot_add(Monitor *mon, const QDict *qdict) monitor_printf(mon, "invalid type: %s\n", type); if (dev) { - qemu_system_device_hot_add(pci_bus_num(dev->bus), - PCI_SLOT(dev->devfn), 1); monitor_printf(mon, "OK domain %d, bus %d, slot %d, function %d\n", 0, pci_bus_num(dev->bus), PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn)); @@ -210,8 +208,7 @@ void pci_device_hot_remove(Monitor *mon, const char *pci_addr) monitor_printf(mon, "slot %d empty\n", slot); return; } - - qemu_system_device_hot_add(bus, slot, 0); + qdev_unplug(&d->qdev); } void do_pci_device_hot_remove(Monitor *mon, const QDict *qdict) @@ -230,16 +227,10 @@ static int pci_match_fn(void *dev_private, void *arg) /* * OS has executed _EJ0 method, we now can remove the device */ -void pci_device_hot_remove_success(int pcibus, int slot) +void pci_device_hot_remove_success(PCIDevice *d) { - PCIDevice *d = pci_find_device(pcibus, slot, 0); int class_code; - if (!d) { - monitor_printf(cur_mon, "invalid slot %d\n", slot); - return; - } - class_code = d->config_read(d, PCI_CLASS_DEVICE+1, 1); switch(class_code) { @@ -250,7 +241,5 @@ void pci_device_hot_remove_success(int pcibus, int slot) destroy_nic(pci_match_fn, d); break; } - - qdev_free(&d->qdev); } -- cgit 1.4.1