All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: Eric Blake <eblake@redhat.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Eduardo Habkost <ehabkost@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Juan Quintela <quintela@redhat.com>,
	qemu-devel@nongnu.org, alistair.francis@xilinx.com,
	zhanghailiang <zhang.zhanghailiang@huawei.com>,
	"open list:X86" <xen-devel@lists.xenproject.org>,
	Anthony Perard <anthony.perard@citrix.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH v5 2/4] shutdown: Prepare for use of an enum in reset/shutdown_request
Date: Fri, 28 Apr 2017 16:45:14 +0200	[thread overview]
Message-ID: <87o9vgbngl.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20170428080821.GB2085@work-vm> (David Alan Gilbert's message of "Fri, 28 Apr 2017 09:08:22 +0100")

"Dr. David Alan Gilbert" <dgilbert@redhat.com> writes:

> * Eric Blake (eblake@redhat.com) wrote:
>> We want to track why a guest was shutdown; in particular, being able
>> to tell the difference between a guest request (such as ACPI request)
>> and host request (such as SIGINT) will prove useful to libvirt.
>> Since all requests eventually end up changing shutdown_requested in
>> vl.c, the logical change is to make that value track the reason,
>> rather than its current 0/1 contents.
>> 
>> Since command-line options control whether a reset request is turned
>> into a shutdown request instead, the same treatment is given to
>> reset_requested.
>> 
>> This patch adds a QAPI enum ShutdownCause that describes reasons
>> that a shutdown can be requested, and changes qemu_system_reset() to
>> pass the reason through, although for now it is not reported.  The
>> next patch will actually wire things up to modify events to report
>> data based on the reason, and to pass the correct enum value in from
>> various call-sites that can trigger a reset/shutdown.  Since QAPI
>> generates enums starting at 0, it's easier if we use a different
>> number as our sentinel that no request has happened yet.  Most of
>> the changes are in vl.c, but xen was using things externally.
>> 
>> Signed-off-by: Eric Blake <eblake@redhat.com>
>> 
>> ---
>> v4: s/ShutdownType/ShutdownCause/, no thanks to mingw header pollution
>> v3: new patch
>> ---
>>  qapi-schema.json        | 23 +++++++++++++++++++++++
>>  include/sysemu/sysemu.h |  2 +-
>>  vl.c                    | 44 ++++++++++++++++++++++++++++----------------
>>  hw/i386/xen/xen-hvm.c   |  9 ++++++---
>>  migration/colo.c        |  2 +-
>>  migration/savevm.c      |  2 +-
>>  6 files changed, 60 insertions(+), 22 deletions(-)
>> 
>> diff --git a/qapi-schema.json b/qapi-schema.json
>> index 01b087f..a4ebdd1 100644
>> --- a/qapi-schema.json
>> +++ b/qapi-schema.json
>> @@ -2304,6 +2304,29 @@
>>  { 'command': 'system_powerdown' }
>> 
>>  ##
>> +# @ShutdownCause:
>> +#
>> +# Enumeration of various causes for shutdown.
>> +#
>> +# @host-qmp: Reaction to a QMP command, such as 'quit'
>> +# @host-signal: Reaction to a signal, such as SIGINT
>> +# @host-ui: Reaction to a UI event, such as closing the window
>> +# @host-replay: The host is replaying an earlier shutdown event
>> +# @host-error: Qemu encountered an error that prevents further use of the guest
>> +# @guest-shutdown: The guest requested a shutdown, such as via ACPI or
>> +#                  other hardware-specific action
>> +# @guest-reset: The guest requested a reset, and the command line
>> +#               response to a reset is to instead trigger a shutdown
>> +# @guest-panic: The guest panicked, and the command line response to
>> +#               a panic is to trigger a shutdown
>
> It's a little coarse grained;  is there anyway to pass platform specific information
> for debug?  I ask because I spent a while debugging a few bugs with unexpected
> resets and had to figure out which of x86's many reset causes triggered it.

Asking for more help with debugging is fair, but I think the need is
better served by tracepoints than by exposing even more detail in QMP,
where compatibility promises apply.

WARNING: multiple messages have this Message-ID (diff)
From: Markus Armbruster <armbru@redhat.com>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Juan Quintela <quintela@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	qemu-devel@nongnu.org, alistair.francis@xilinx.com,
	Paolo Bonzini <pbonzini@redhat.com>,
	Anthony Perard <anthony.perard@citrix.com>,
	"open list:X86" <xen-devel@lists.xenproject.org>,
	Richard Henderson <rth@twiddle.net>,
	Eric Blake <eblake@redhat.com>,
	zhanghailiang <zhang.zhanghailiang@huawei.com>
Subject: Re: [Qemu-devel] [PATCH v5 2/4] shutdown: Prepare for use of an enum in reset/shutdown_request
Date: Fri, 28 Apr 2017 16:45:14 +0200	[thread overview]
Message-ID: <87o9vgbngl.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20170428080821.GB2085@work-vm> (David Alan Gilbert's message of "Fri, 28 Apr 2017 09:08:22 +0100")

"Dr. David Alan Gilbert" <dgilbert@redhat.com> writes:

> * Eric Blake (eblake@redhat.com) wrote:
>> We want to track why a guest was shutdown; in particular, being able
>> to tell the difference between a guest request (such as ACPI request)
>> and host request (such as SIGINT) will prove useful to libvirt.
>> Since all requests eventually end up changing shutdown_requested in
>> vl.c, the logical change is to make that value track the reason,
>> rather than its current 0/1 contents.
>> 
>> Since command-line options control whether a reset request is turned
>> into a shutdown request instead, the same treatment is given to
>> reset_requested.
>> 
>> This patch adds a QAPI enum ShutdownCause that describes reasons
>> that a shutdown can be requested, and changes qemu_system_reset() to
>> pass the reason through, although for now it is not reported.  The
>> next patch will actually wire things up to modify events to report
>> data based on the reason, and to pass the correct enum value in from
>> various call-sites that can trigger a reset/shutdown.  Since QAPI
>> generates enums starting at 0, it's easier if we use a different
>> number as our sentinel that no request has happened yet.  Most of
>> the changes are in vl.c, but xen was using things externally.
>> 
>> Signed-off-by: Eric Blake <eblake@redhat.com>
>> 
>> ---
>> v4: s/ShutdownType/ShutdownCause/, no thanks to mingw header pollution
>> v3: new patch
>> ---
>>  qapi-schema.json        | 23 +++++++++++++++++++++++
>>  include/sysemu/sysemu.h |  2 +-
>>  vl.c                    | 44 ++++++++++++++++++++++++++++----------------
>>  hw/i386/xen/xen-hvm.c   |  9 ++++++---
>>  migration/colo.c        |  2 +-
>>  migration/savevm.c      |  2 +-
>>  6 files changed, 60 insertions(+), 22 deletions(-)
>> 
>> diff --git a/qapi-schema.json b/qapi-schema.json
>> index 01b087f..a4ebdd1 100644
>> --- a/qapi-schema.json
>> +++ b/qapi-schema.json
>> @@ -2304,6 +2304,29 @@
>>  { 'command': 'system_powerdown' }
>> 
>>  ##
>> +# @ShutdownCause:
>> +#
>> +# Enumeration of various causes for shutdown.
>> +#
>> +# @host-qmp: Reaction to a QMP command, such as 'quit'
>> +# @host-signal: Reaction to a signal, such as SIGINT
>> +# @host-ui: Reaction to a UI event, such as closing the window
>> +# @host-replay: The host is replaying an earlier shutdown event
>> +# @host-error: Qemu encountered an error that prevents further use of the guest
>> +# @guest-shutdown: The guest requested a shutdown, such as via ACPI or
>> +#                  other hardware-specific action
>> +# @guest-reset: The guest requested a reset, and the command line
>> +#               response to a reset is to instead trigger a shutdown
>> +# @guest-panic: The guest panicked, and the command line response to
>> +#               a panic is to trigger a shutdown
>
> It's a little coarse grained;  is there anyway to pass platform specific information
> for debug?  I ask because I spent a while debugging a few bugs with unexpected
> resets and had to figure out which of x86's many reset causes triggered it.

Asking for more help with debugging is fair, but I think the need is
better served by tracepoints than by exposing even more detail in QMP,
where compatibility promises apply.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2017-04-28 14:45 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-28  2:13 [Qemu-devel] [PATCH v5 0/4] event: Add source information to SHUTDOWN Eric Blake
2017-04-28  2:13 ` [Qemu-devel] [PATCH v5 1/4] shutdown: Simplify shutdown_signal Eric Blake
2017-04-28 14:42   ` Markus Armbruster
2017-04-28  2:13 ` [Qemu-devel] [PATCH v5 2/4] shutdown: Prepare for use of an enum in reset/shutdown_request Eric Blake
2017-04-28  2:13   ` Eric Blake
2017-04-28  8:08   ` [Qemu-devel] " Dr. David Alan Gilbert
2017-04-28  8:08     ` Dr. David Alan Gilbert
2017-04-28 14:35     ` [Qemu-devel] " Eric Blake
2017-04-28 14:35       ` Eric Blake
2017-04-28 15:27       ` [Qemu-devel] " Dr. David Alan Gilbert
2017-04-28 15:27         ` Dr. David Alan Gilbert
2017-04-28 15:57         ` [Qemu-devel] " Eric Blake
2017-04-28 15:57           ` Eric Blake
2017-04-28 16:09           ` [Qemu-devel] " Dr. David Alan Gilbert
2017-04-28 16:09             ` Dr. David Alan Gilbert
2017-04-28 18:05             ` [Qemu-devel] " Eric Blake
2017-04-28 18:05               ` Eric Blake
2017-04-28 18:13               ` [Qemu-devel] " Dr. David Alan Gilbert
2017-04-28 18:13                 ` Dr. David Alan Gilbert
2017-04-28 14:45     ` Markus Armbruster [this message]
2017-04-28 14:45       ` [Qemu-devel] " Markus Armbruster
2017-04-28 14:42   ` Markus Armbruster
2017-04-28 14:42     ` Markus Armbruster
2017-04-28 22:34     ` Eric Blake
2017-04-28 22:34       ` Eric Blake
2017-05-02 11:47       ` Markus Armbruster
2017-05-02 11:47         ` Markus Armbruster
2017-04-28  2:13 ` [PATCH v5 3/4] shutdown: Add source information to SHUTDOWN and RESET Eric Blake
2017-04-28  2:13 ` Eric Blake
2017-04-28  2:13   ` [Qemu-devel] " Eric Blake
2017-04-28 15:01   ` Markus Armbruster
2017-04-28 15:01     ` Markus Armbruster
2017-04-28 22:44     ` [Qemu-devel] replay help [was: [PATCH v5 3/4] shutdown: Add source information to SHUTDOWN and RESET] Eric Blake
2017-05-02 10:54       ` Pavel Dovgalyuk
2017-05-02  8:13     ` [Qemu-devel] [PATCH v5 3/4] shutdown: Add source information to SHUTDOWN and RESET Pavel Dovgalyuk
2017-05-02  8:13       ` Pavel Dovgalyuk
2017-05-02  8:13     ` Pavel Dovgalyuk
2017-04-28 15:01   ` Markus Armbruster
2017-05-01  3:58   ` David Gibson
2017-05-01  3:58   ` David Gibson
2017-05-01  3:58     ` [Qemu-devel] " David Gibson
2017-05-05  8:36   ` Mark Cave-Ayland
2017-04-28  2:13 ` [Qemu-devel] [PATCH v5 4/4] RFC: shutdown: Expose full ShutdownCause across QMP Eric Blake
2017-04-28 22:48   ` Eric Blake

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=87o9vgbngl.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=alistair.francis@xilinx.com \
    --cc=anthony.perard@citrix.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=rth@twiddle.net \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    --cc=zhang.zhanghailiang@huawei.com \
    /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.