mirror of
https://github.com/mii443/qemu.git
synced 2025-12-16 17:18:49 +00:00
qmp: generalize watchdog-set-action to -no-reboot/-no-shutdown
Add a QMP command to allow for the behaviors specified by the
-no-reboot and -no-shutdown command line option to be set at runtime.
The new command is named set-action and takes optional arguments, named
after an event, that provide a corresponding action to take.
Example:
-> { "execute": "set-action",
"arguments": {
"reboot": "none",
"shutdown": "poweroff",
"watchdog": "debug" } }
<- { "return": {} }
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
Message-Id: <1607705564-26264-4-git-send-email-alejandro.j.jimenez@oracle.com>
[Split the series differently, with -action based on the QMP command. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
committed by
Paolo Bonzini
parent
ebe3444468
commit
e6dba04813
@@ -30,6 +30,7 @@
|
||||
#include "ui/input.h"
|
||||
#include "ui/sdl2.h"
|
||||
#include "sysemu/runstate.h"
|
||||
#include "sysemu/runstate-action.h"
|
||||
#include "sysemu/sysemu.h"
|
||||
#include "ui/win32-kbd-hook.h"
|
||||
|
||||
@@ -606,7 +607,7 @@ static void handle_windowevent(SDL_Event *ev)
|
||||
allow_close = false;
|
||||
}
|
||||
if (allow_close) {
|
||||
no_shutdown = 0;
|
||||
shutdown_action = SHUTDOWN_ACTION_POWEROFF;
|
||||
qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_UI);
|
||||
}
|
||||
} else {
|
||||
@@ -653,7 +654,7 @@ void sdl2_poll_events(struct sdl2_console *scon)
|
||||
allow_close = false;
|
||||
}
|
||||
if (allow_close) {
|
||||
no_shutdown = 0;
|
||||
shutdown_action = SHUTDOWN_ACTION_POWEROFF;
|
||||
qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_UI);
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user