From c753e8e72548493d2a110c0482c4a987a733b033 Mon Sep 17 00:00:00 2001 From: Alejandro Jimenez Date: Fri, 11 Dec 2020 17:31:52 -0500 Subject: vl: Add option to avoid stopping VM upon guest panic The current default action of pausing a guest after a panic event is received leaves the responsibility to resume guest execution to the management layer. The reasons for this behavior are discussed here: https://lore.kernel.org/qemu-devel/52148F88.5000509@redhat.com/ However, in instances like the case of older guests (Linux and Windows) using a pvpanic device but missing support for the PVPANIC_CRASHLOADED event, and Windows guests using the hv-crash enlightenment, it is desirable to allow the guests to continue running after sending a PVPANIC_PANICKED event. This allows such guests to proceed to capture a crash dump and automatically reboot without intervention of a management layer. Add an option to avoid stopping a VM after a panic event is received, by passing: -action panic=none in the command line arguments, or during runtime by using an upcoming QMP command. Suggested-by: Paolo Bonzini Signed-off-by: Alejandro Jimenez Message-Id: <1607705564-26264-3-git-send-email-alejandro.j.jimenez@oracle.com> [Do not fix panic action in the variable, instead modify -no-shutdown. - Paolo] Signed-off-by: Paolo Bonzini --- qapi/run-state.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'qapi') diff --git a/qapi/run-state.json b/qapi/run-state.json index 25e82d1be1..1f3b329f05 100644 --- a/qapi/run-state.json +++ b/qapi/run-state.json @@ -353,6 +353,18 @@ { 'enum': 'ShutdownAction', 'data': [ 'poweroff', 'pause' ] } +## +# @PanicAction: +# +# @none: Continue VM execution +# +# @pause: Pause the VM +# +# Since: 6.0 +## +{ 'enum': 'PanicAction', + 'data': [ 'poweroff', 'pause', 'none' ] } + ## # @watchdog-set-action: # @@ -372,6 +384,8 @@ # # @shutdown: @ShutdownAction action taken on guest shutdown. # +# @panic: @PanicAction action taken on guest panic. +# # @watchdog: @WatchdogAction action taken when watchdog timer expires . # # Returns: Nothing on success. @@ -383,12 +397,14 @@ # -> { "execute": "set-action", # "arguments": { "reboot": "shutdown", # "shutdown" : "pause", +# "panic": "pause", # "watchdog": "inject-nmi" } } # <- { "return": {} } ## { 'command': 'set-action', 'data': { '*reboot': 'RebootAction', '*shutdown': 'ShutdownAction', + '*panic': 'PanicAction', '*watchdog': 'WatchdogAction' }, 'allow-preconfig': true } -- cgit v1.2.3-55-g7522