mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-10 02:54:58 -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
|
@ -768,6 +768,7 @@ static void build_pci_bus_end(PCIBus *bus, void *bus_state)
|
|||
memset(slot_hotplug_enable, 0xff, sizeof slot_hotplug_enable);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(bus->devices); ++i) {
|
||||
DeviceClass *dc;
|
||||
PCIDeviceClass *pc;
|
||||
PCIDevice *pdev = bus->devices[i];
|
||||
|
||||
|
@ -776,8 +777,9 @@ static void build_pci_bus_end(PCIBus *bus, void *bus_state)
|
|||
}
|
||||
|
||||
pc = PCI_DEVICE_GET_CLASS(pdev);
|
||||
dc = DEVICE_GET_CLASS(pdev);
|
||||
|
||||
if (pc->no_hotplug || pc->is_bridge) {
|
||||
if (!dc->hotpluggable || pc->is_bridge) {
|
||||
int slot = PCI_SLOT(i);
|
||||
|
||||
clear_bit(slot, slot_hotplug_enable);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue