From: Eric Blake <eblake@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
Subject: Re: [PATCH] runstate: cleanup reboot and panic actions
Date: Wed, 20 Jan 2021 09:55:26 -0600 [thread overview]
Message-ID: <73368783-b35e-8363-b027-b210cbc3ec23@redhat.com> (raw)
In-Reply-To: <20210120143706.345821-1-pbonzini@redhat.com>
On 1/20/21 8:37 AM, Paolo Bonzini wrote:
> The possible choices for panic, reset and watchdog actions are inconsistent.
>
> "-action panic=poweroff" should be renamed to "-action panic=shutdown"
> on the command line. This is because "-action panic=poweroff" and
> "-action watchdog=poweroff" have slightly different semantics, the first
> does an unorderly exit while the second goes through qemu_cleanup(). With
> this change, -no-shutdown would not have to change "-action panic=pause"
> "pause", just like it does not have to change the reset action.
>
> "-action reboot=none" should be renamed to "-action reboot=reset".
> This should be self explanatory, since for example "-action panic=none"
> lets the guest proceed without taking any action.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> qapi/run-state.json | 10 ++++++----
> qemu-options.hx | 8 ++++----
> softmmu/runstate-action.c | 4 ++--
> softmmu/runstate.c | 7 ++++---
> softmmu/vl.c | 2 +-
> 5 files changed, 17 insertions(+), 14 deletions(-)
>
> diff --git a/qapi/run-state.json b/qapi/run-state.json
> index 1f3b329f05..43d66d700f 100644
> --- a/qapi/run-state.json
> +++ b/qapi/run-state.json
> @@ -330,14 +330,14 @@
> #
> # Possible QEMU actions upon guest reboot
> #
> -# @none: Reset the VM
> +# @reset: Reset the VM
> #
> -# @shutdown: Shutdown the VM and exit
> +# @shutdown: Shutdown the VM and exit, according to the shutdown action
> #
> # Since: 6.0
> ##
> { 'enum': 'RebootAction',
> - 'data': [ 'none', 'shutdown' ] }
> + 'data': [ 'reset', 'shutdown' ] }
Given that the enum is new, we are not locked into back-compat, so
changing the names to be consistent is reasonable.
Reviewed-by: Eric Blake <eblake$redhat.com>
> +++ b/softmmu/runstate.c
> @@ -471,14 +471,15 @@ void qemu_system_guest_panicked(GuestPanicInformation *info)
> }
> /*
> * TODO: Currently the available panic actions are: none, pause, and
> - * poweroff, but in principle debug and reset could be supported as well.
> + * shutdown, but in principle debug and reset could be supported as well.
> * Investigate any potential use cases for the unimplemented actions.
> */
> - if (panic_action == PANIC_ACTION_PAUSE) {
> + if (panic_action == PANIC_ACTION_PAUSE
> + || (panic_action == PANIC_ACTION_SHUTDOWN && shutdown_action == SHUTDOWN_ACTION_PAUSE)) {
Long line.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
next prev parent reply other threads:[~2021-01-20 15:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-20 14:37 [PATCH] runstate: cleanup reboot and panic actions Paolo Bonzini
2021-01-20 14:42 ` no-reply
2021-01-20 15:55 ` Eric Blake [this message]
2021-01-20 18:09 ` Alejandro Jimenez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=73368783-b35e-8363-b027-b210cbc3ec23@redhat.com \
--to=eblake@redhat.com \
--cc=alejandro.j.jimenez@oracle.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).