This patch adds accessors for acpi-root-pci-hotplug property. PCI
hotplug can be enabled/disabled with:
  -global ICH9-LPC.acpi-root-pci-hotplug=on|off

Signed-off-by: Thierry Escande <thierry.esca...@vates.tech>
---
 hw/acpi/ich9.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
index e21732b547..e38c9bb998 100644
--- a/hw/acpi/ich9.c
+++ b/hw/acpi/ich9.c
@@ -413,6 +413,20 @@ static void ich9_pm_set_acpi_hotplug_bridge(Object *obj, 
bool value,
     s->pm.acpi_pci_hotplug.use_acpi_hotplug_bridge = value;
 }
 
+static bool ich9_pm_get_acpi_pci_hotplug(Object *obj, Error **errp)
+{
+    ICH9LPCState *s = ICH9_LPC_DEVICE(obj);
+
+    return s->pm.acpi_pci_hotplug.use_acpi_root_pci_hotplug;
+}
+
+static void ich9_pm_set_acpi_pci_hotplug(Object *obj, bool value, Error **errp)
+{
+    ICH9LPCState *s = ICH9_LPC_DEVICE(obj);
+
+    s->pm.acpi_pci_hotplug.use_acpi_root_pci_hotplug = value;
+}
+
 static bool ich9_pm_get_keep_pci_slot_hpc(Object *obj, Error **errp)
 {
     ICH9LPCState *s = ICH9_LPC_DEVICE(obj);
@@ -464,6 +478,9 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm)
     object_property_add_bool(obj, ACPI_PM_PROP_ACPI_PCIHP_BRIDGE,
                              ich9_pm_get_acpi_hotplug_bridge,
                              ich9_pm_set_acpi_hotplug_bridge);
+    object_property_add_bool(obj, ACPI_PM_PROP_ACPI_PCI_ROOTHP,
+                             ich9_pm_get_acpi_pci_hotplug,
+                             ich9_pm_set_acpi_pci_hotplug);
     object_property_add_bool(obj, "x-keep-pci-slot-hpc",
                              ich9_pm_get_keep_pci_slot_hpc,
                              ich9_pm_set_keep_pci_slot_hpc);
-- 
2.42.0



Thierry Escande | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech

Reply via email to