mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
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>
This commit is contained in:
parent
5fdae20cef
commit
2897ae0267
16 changed files with 21 additions and 30 deletions
|
@ -105,12 +105,13 @@ static PCIBus *acpi_pcihp_find_hotplug_bus(AcpiPciHpState *s, int bsel)
|
|||
static bool acpi_pcihp_pc_no_hotplug(AcpiPciHpState *s, PCIDevice *dev)
|
||||
{
|
||||
PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(dev);
|
||||
DeviceClass *dc = DEVICE_GET_CLASS(dev);
|
||||
/*
|
||||
* ACPI doesn't allow hotplug of bridge devices. Don't allow
|
||||
* hot-unplug of bridge devices unless they were added by hotplug
|
||||
* (and so, not described by acpi).
|
||||
*/
|
||||
return (pc->is_bridge && !dev->qdev.hotplugged) || pc->no_hotplug;
|
||||
return (pc->is_bridge && !dev->qdev.hotplugged) || !dc->hotpluggable;
|
||||
}
|
||||
|
||||
static void acpi_pcihp_eject_slot(AcpiPciHpState *s, unsigned bsel, unsigned slots)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue