aboutsummaryrefslogtreecommitdiff
path: root/qapi
diff options
context:
space:
mode:
authorAlejandro Jimenez <alejandro.j.jimenez@oracle.com>2020-12-11 11:52:43 -0500
committerPaolo Bonzini <pbonzini@redhat.com>2020-12-15 12:51:57 -0500
commite6dba0481363ad343c5f984dd4de3dd06d79ee68 (patch)
tree8c970cec81095fd7cb39f9b8b011f335f4bf5ec2 /qapi
parentebe3444468a4913e0208db1f74ea9336c7580202 (diff)
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>
Diffstat (limited to 'qapi')
-rw-r--r--qapi/run-state.json58
1 files changed, 58 insertions, 0 deletions
diff --git a/qapi/run-state.json b/qapi/run-state.json
index a47c500f83..25e82d1be1 100644
--- a/qapi/run-state.json
+++ b/qapi/run-state.json
@@ -326,6 +326,34 @@
'inject-nmi' ] }
##
+# @RebootAction:
+#
+# Possible QEMU actions upon guest reboot
+#
+# @none: Reset the VM
+#
+# @shutdown: Shutdown the VM and exit
+#
+# Since: 6.0
+##
+{ 'enum': 'RebootAction',
+ 'data': [ 'none', 'shutdown' ] }
+
+##
+# @ShutdownAction:
+#
+# Possible QEMU actions upon guest shutdown
+#
+# @poweroff: Shutdown the VM and exit
+#
+# @pause: pause the VM#
+#
+# Since: 6.0
+##
+{ 'enum': 'ShutdownAction',
+ 'data': [ 'poweroff', 'pause' ] }
+
+##
# @watchdog-set-action:
#
# Set watchdog action
@@ -335,6 +363,36 @@
{ 'command': 'watchdog-set-action', 'data' : {'action': 'WatchdogAction'} }
##
+# @set-action:
+#
+# Set the actions that will be taken by the emulator in response to guest
+# events.
+#
+# @reboot: @RebootAction action taken on guest reboot.
+#
+# @shutdown: @ShutdownAction action taken on guest shutdown.
+#
+# @watchdog: @WatchdogAction action taken when watchdog timer expires .
+#
+# Returns: Nothing on success.
+#
+# Since: 6.0
+#
+# Example:
+#
+# -> { "execute": "set-action",
+# "arguments": { "reboot": "shutdown",
+# "shutdown" : "pause",
+# "watchdog": "inject-nmi" } }
+# <- { "return": {} }
+##
+{ 'command': 'set-action',
+ 'data': { '*reboot': 'RebootAction',
+ '*shutdown': 'ShutdownAction',
+ '*watchdog': 'WatchdogAction' },
+ 'allow-preconfig': true }
+
+##
# @GUEST_PANICKED:
#
# Emitted when guest OS panic is detected