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>
This commit is contained in:
Gerd Hoffmann 2009-09-25 21:42:45 +02:00 committed by Anthony Liguori
parent ee995ffbf7
commit 3f84865ade
5 changed files with 26 additions and 42 deletions

View file

@ -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);
}