From 02c106139a5c01a5668246c748939b5a4bb0c467 Mon Sep 17 00:00:00 2001 From: Igor Mammedov Date: Thu, 2 Mar 2023 17:15:41 +0100 Subject: acpi: pci: move out ACPI PCI hotplug generator from generic slot generator build_append_pci_bus_devices() Signed-off-by: Igor Mammedov Message-Id: <20230302161543.286002-33-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/acpi/pci-bridge.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'hw/acpi') diff --git a/hw/acpi/pci-bridge.c b/hw/acpi/pci-bridge.c index 4fbf6da..7baa703 100644 --- a/hw/acpi/pci-bridge.c +++ b/hw/acpi/pci-bridge.c @@ -22,6 +22,16 @@ void build_pci_bridge_aml(AcpiDevAmlIf *adev, Aml *scope) PCIBridge *br = PCI_BRIDGE(adev); if (!DEVICE(br)->hotplugged) { - build_append_pci_bus_devices(scope, pci_bridge_get_sec_bus(br)); + PCIBus *sec_bus = pci_bridge_get_sec_bus(br); + + build_append_pci_bus_devices(scope, sec_bus); + + /* + * generate hotplug slots descriptors if + * bridge has ACPI PCI hotplug attached, + */ + if (object_property_find(OBJECT(sec_bus), ACPI_PCIHP_PROP_BSEL)) { + build_append_pcihp_slots(scope, sec_bus); + } } } -- cgit v1.1