qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] runstate: cleanup reboot and panic actions


From: Eric Blake
Subject: Re: [PATCH] runstate: cleanup reboot and panic actions
Date: Wed, 20 Jan 2021 09:55:26 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]