2 * Copyright (c) 2020 Oracle and/or its affiliates.
4 * This work is licensed under the terms of the GNU GPL, version 2.
5 * See the COPYING file in the top-level directory.
9 #include "qemu/osdep.h"
10 #include "sysemu/runstate-action.h"
11 #include "sysemu/watchdog.h"
12 #include "qemu/config-file.h"
13 #include "qapi/error.h"
14 #include "qemu/option_int.h"
16 RebootAction reboot_action
= REBOOT_ACTION_RESET
;
17 ShutdownAction shutdown_action
= SHUTDOWN_ACTION_POWEROFF
;
18 PanicAction panic_action
= PANIC_ACTION_SHUTDOWN
;
21 * Receives actions to be applied for specific guest events
22 * and sets the internal state as requested.
24 void qmp_set_action(bool has_reboot
, RebootAction reboot
,
25 bool has_shutdown
, ShutdownAction shutdown
,
26 bool has_panic
, PanicAction panic
,
27 bool has_watchdog
, WatchdogAction watchdog
,
31 reboot_action
= reboot
;
39 qmp_watchdog_set_action(watchdog
, errp
);
42 /* Process shutdown last, in case the panic action needs to be altered */
44 shutdown_action
= shutdown
;