mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00

Headers in include/sysemu/ are not only related to system *emulation*, they are also used by virtualization. Rename as system/ which is clearer. Files renamed manually then mechanical change using sed tool. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Tested-by: Lei Yang <leiyang@redhat.com> Message-Id: <20241203172445.28576-1-philmd@linaro.org>
46 lines
1.2 KiB
C
46 lines
1.2 KiB
C
/*
|
|
* Copyright (c) 2020 Oracle and/or its affiliates.
|
|
*
|
|
* This work is licensed under the terms of the GNU GPL, version 2.
|
|
* See the COPYING file in the top-level directory.
|
|
*
|
|
*/
|
|
|
|
#include "qemu/osdep.h"
|
|
#include "system/runstate-action.h"
|
|
#include "system/watchdog.h"
|
|
#include "qemu/config-file.h"
|
|
#include "qapi/error.h"
|
|
#include "qemu/option_int.h"
|
|
|
|
RebootAction reboot_action = REBOOT_ACTION_RESET;
|
|
ShutdownAction shutdown_action = SHUTDOWN_ACTION_POWEROFF;
|
|
PanicAction panic_action = PANIC_ACTION_SHUTDOWN;
|
|
|
|
/*
|
|
* Receives actions to be applied for specific guest events
|
|
* and sets the internal state as requested.
|
|
*/
|
|
void qmp_set_action(bool has_reboot, RebootAction reboot,
|
|
bool has_shutdown, ShutdownAction shutdown,
|
|
bool has_panic, PanicAction panic,
|
|
bool has_watchdog, WatchdogAction watchdog,
|
|
Error **errp)
|
|
{
|
|
if (has_reboot) {
|
|
reboot_action = reboot;
|
|
}
|
|
|
|
if (has_panic) {
|
|
panic_action = panic;
|
|
}
|
|
|
|
if (has_watchdog) {
|
|
qmp_watchdog_set_action(watchdog, errp);
|
|
}
|
|
|
|
/* Process shutdown last, in case the panic action needs to be altered */
|
|
if (has_shutdown) {
|
|
shutdown_action = shutdown;
|
|
}
|
|
}
|