diff options
author | Igor Mammedov <imammedo@redhat.com> | 2014-02-05 16:36:48 +0100 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2014-02-10 10:26:56 +0200 |
commit | 2897ae026758eac78284ba6c3bd7732f3a1d9987 (patch) | |
tree | 5bda64525a4099f46ba288800916f041143f5974 /hw/pci | |
parent | 5fdae20cef2857a2c63c8d4fa7df6274d6d7c3c8 (diff) |
qdev:pci: refactor PCIDevice to use generic "hotpluggable" property
Get rid of PCIDevice specific PCIDeviceClass.no_hotplug and use
generic DeviceClass.hotpluggable field instead.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/pci')
-rw-r--r-- | hw/pci/pci.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 1221f32847..d69961f410 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -1761,11 +1761,7 @@ static int pci_qdev_init(DeviceState *qdev) pci_dev->devfn); if (pci_dev == NULL) return -1; - if (qdev->hotplugged && pc->no_hotplug) { - qerror_report(QERR_DEVICE_NO_HOTPLUG, object_get_typename(OBJECT(pci_dev))); - do_pci_unregister_device(pci_dev); - return -1; - } + if (pc->init) { rc = pc->init(pci_dev); if (rc != 0) { @@ -1800,12 +1796,7 @@ static int pci_qdev_init(DeviceState *qdev) static int pci_unplug_device(DeviceState *qdev) { PCIDevice *dev = PCI_DEVICE(qdev); - PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(dev); - if (pc->no_hotplug) { - qerror_report(QERR_DEVICE_NO_HOTPLUG, object_get_typename(OBJECT(dev))); - return -1; - } return dev->bus->hotplug(dev->bus->hotplug_qdev, dev, PCI_HOTPLUG_DISABLED); } |