aboutsummaryrefslogtreecommitdiff
path: root/hw/watchdog
diff options
context:
space:
mode:
Diffstat (limited to 'hw/watchdog')
-rw-r--r--hw/watchdog/watchdog.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/hw/watchdog/watchdog.c b/hw/watchdog/watchdog.c
index 0d3eeed187..670114ecfe 100644
--- a/hw/watchdog/watchdog.c
+++ b/hw/watchdog/watchdog.c
@@ -29,6 +29,7 @@
#include "qapi-event.h"
#include "hw/nmi.h"
#include "qemu/help_option.h"
+#include "qmp-commands.h"
static WatchdogAction watchdog_action = WATCHDOG_ACTION_RESET;
static QLIST_HEAD(watchdog_list, WatchdogTimerModel) watchdog_list;
@@ -85,7 +86,7 @@ int select_watchdog_action(const char *p)
g_free(qapi_value);
if (action < 0)
return -1;
- watchdog_action = action;
+ qmp_watchdog_set_action(action, &error_abort);
return 0;
}
@@ -142,3 +143,8 @@ void watchdog_perform_action(void)
assert(0);
}
}
+
+void qmp_watchdog_set_action(WatchdogAction action, Error **errp)
+{
+ watchdog_action = action;
+}