It will be used by following code to enable ACPI watchdog.
Initial support will bring it to Q35 and arm/virt machines using
respective iTCO and GWDT watchdogs as hardware backend.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
include/hw/core/boards.h | 1 +
hw/core/machine.c | 20 ++++++++++++++++++++
2 files changed, 21 insertions(+)
diff --git a/include/hw/core/boards.h b/include/hw/core/boards.h
index 07f8938752..25577c3aac 100644
--- a/include/hw/core/boards.h
+++ b/include/hw/core/boards.h
@@ -447,6 +447,7 @@ struct MachineState {
struct NVDIMMState *nvdimms_state;
struct NumaState *numa_state;
bool acpi_spcr_enabled;
+ bool acpi_watchdog;
};
/*
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 6411e68856..4ca808fb73 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -499,6 +499,20 @@ static void machine_set_usb(Object *obj, bool value, Error **errp)
ms->usb_disabled = !value;
}
+static bool machine_get_acpi_watchdog(Object *obj, Error **errp)
+{
+ MachineState *ms = MACHINE(obj);
+
+ return ms->acpi_watchdog;
+}
+
+static void machine_set_acpi_watchdog(Object *obj, bool value, Error **errp)
+{
+ MachineState *ms = MACHINE(obj);
+
+ ms->acpi_watchdog = value;
+}
+
static bool machine_get_graphics(Object *obj, Error **errp)
{
MachineState *ms = MACHINE(obj);
@@ -1257,6 +1271,12 @@ static void machine_class_init(ObjectClass *oc, const void *data)
NULL, NULL);
object_class_property_set_description(oc, "memory",
"Memory size configuration");
+
+ object_class_property_add_bool(oc, "acpi-watchdog",
+ machine_get_acpi_watchdog, machine_set_acpi_watchdog);
+ object_class_property_set_description(oc, "acpi-watchdog",
+ "Set on/off to enable/disable ACPI watchdog."
+ " Default: off (ACPI watchdog is disabled).");
}
static void machine_class_base_init(ObjectClass *oc, const void *data)
--
2.47.3