All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH/RFC] vl: add no-panic option
Date: Mon, 17 Oct 2016 08:50:47 -0400 (EDT)	[thread overview]
Message-ID: <556323133.4026709.1476708647964.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <1476706440-112198-1-git-send-email-borntraeger@de.ibm.com>

> Some testcase will trigger a guest panic state. For testing purposes
> it can be useful to exit QEMU anyway.

I wonder if this should be done by default *unless* -no-shutdown is
provided.  This would require some planning (and delay this to 2.9,
in all likelihood), but it probably would be pretty nice for general
usage.

Paolo

> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> ---
>  qemu-options.hx | 9 +++++++++
>  vl.c            | 6 ++++++
>  2 files changed, 15 insertions(+)
> 
> diff --git a/qemu-options.hx b/qemu-options.hx
> index 01f01df..ee6d3d0 100644
> --- a/qemu-options.hx
> +++ b/qemu-options.hx
> @@ -3301,6 +3301,15 @@ This allows for instance switching to monitor to
> commit changes to the
>  disk image.
>  ETEXI
>  
> +DEF("no-panic", 0, QEMU_OPTION_no_panic, \
> +    "-no-panic       exit QEMU also in guest panic state\n", QEMU_ARCH_ALL)
> +STEXI
> +@item -no-panic
> +@findex -no-panic
> +Exit QEMU on guest panic instead of keeping it alive. This allows for
> +instance running tests that are known to panic at the end.
> +ETEXI
> +
>  DEF("loadvm", HAS_ARG, QEMU_OPTION_loadvm, \
>      "-loadvm [tag|id]\n" \
>      "                start right away with a saved state (loadvm in
>      monitor)\n",
> diff --git a/vl.c b/vl.c
> index f3abd99..57e1d91 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -164,6 +164,7 @@ int no_hpet = 0;
>  int fd_bootchk = 1;
>  static int no_reboot;
>  int no_shutdown = 0;
> +int no_panic = 0;
>  int cursor_hide = 1;
>  int graphic_rotate = 0;
>  const char *watchdog;
> @@ -1774,6 +1775,8 @@ void qemu_system_reset(bool report)
>  
>  void qemu_system_guest_panicked(void)
>  {
> +    if (no_panic)
> +	return qemu_system_shutdown_request();
>      if (current_cpu) {
>          current_cpu->crash_occurred = true;
>      }
> @@ -3780,6 +3783,9 @@ int main(int argc, char **argv, char **envp)
>              case QEMU_OPTION_no_shutdown:
>                  no_shutdown = 1;
>                  break;
> +            case QEMU_OPTION_no_panic:
> +                no_panic = 1;
> +                break;
>              case QEMU_OPTION_show_cursor:
>                  cursor_hide = 0;
>                  break;
> --
> 2.5.5
> 
> 

  reply	other threads:[~2016-10-17 12:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-17 12:14 [Qemu-devel] [PATCH/RFC] vl: add no-panic option Christian Borntraeger
2016-10-17 12:50 ` Paolo Bonzini [this message]
2016-10-17 12:54   ` Christian Borntraeger
2016-10-17 14:37     ` Paolo Bonzini
2016-10-17 13:03 ` no-reply
2016-10-17 17:17 ` Markus Armbruster
2016-10-17 18:08   ` Christian Borntraeger

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=556323133.4026709.1476708647964.JavaMail.zimbra@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=armbru@redhat.com \
    --cc=borntraeger@de.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.