summary refs log tree commit diff stats
path: root/hw/pci-hotplug.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2009-09-25 21:42:45 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-10-05 09:32:49 -0500
commit3f84865ade594a2ec1ef613ab5fd11949f3d49de (patch)
tree0e0080e944f87ca8590e7027a6b5e663f1954d12 /hw/pci-hotplug.c
parentee995ffbf7b2b190b17d65bbd8f85218679156ad (diff)
downloadfocaccia-qemu-3f84865ade594a2ec1ef613ab5fd11949f3d49de.tar.gz
focaccia-qemu-3f84865ade594a2ec1ef613ab5fd11949f3d49de.zip
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 <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/pci-hotplug.c')
-rw-r--r--hw/pci-hotplug.c15
1 files changed, 2 insertions, 13 deletions
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);
 }