All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
To: Eric Blake <eblake@redhat.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v5 3/4] shutdown: Add source information to SHUTDOWN and RESET
Date: Fri, 5 May 2017 09:36:50 +0100	[thread overview]
Message-ID: <1fb98d19-fb1d-831f-7eb1-cabcc15b3884@ilande.co.uk> (raw)
In-Reply-To: <20170428021317.24711-4-eblake@redhat.com>

On 28/04/17 03:13, Eric Blake wrote:

> Libvirt would like to be able to distinguish between a SHUTDOWN
> event triggered solely by guest request and one triggered by a
> SIGTERM or other action on the host.  While qemu_kill_report() is
> already able to tell whether a shutdown was triggered by a host
> signal (but NOT by a host UI event, such as clicking the X on
> the window), that information was then lost after being printed
> to stderr.  The previous patch prepped things to use an enum
> internally; now it's time to wire it up through all callers, and
> to extend the SHUTDOWN and RESET events to report the details.
> 
> Enhance the shutdown request path to take a parameter of which
> way it is being triggered, and update ALL callers.  It would have
> been less churn to keep the common case with no arguments as
> meaning guest-triggered, and only modified the host-triggered
> code paths, via a wrapper function, but then we'd still have to
> audit that I didn't miss any host-triggered spots; changing the
> signature forces us to double-check that I correctly categorized
> all callers.
> 
> Since command line options can change whether a guest reset request
> causes an actual reset vs. a shutdown, it's easy to also add the
> information to the RESET event, even though libvirt has not yet
> expressed a need to know that.
> 
> For the moment, we keep the enum ShutdownCause for internal use
> only, and merely expose a single boolean of 'guest':true|false
> to the QMP client; this is because we don't yet have evidence that
> the further distinctions will be useful, or whether the addition
> of new enum members would cause problems to clients coded to an
> older version of the enum.
> 
> Update expected iotest outputs to match the new data.
> 
> Here is output from 'virsh qemu-monitor-event --loop' with the
> patch installed:
> 
> event SHUTDOWN at 1492639680.731251 for domain fedora_13: {"guest":true}
> event STOP at 1492639680.732116 for domain fedora_13: <null>
> event SHUTDOWN at 1492639680.732830 for domain fedora_13: {"guest":false}
> 
> Note that libvirt runs qemu with -no-quit: the first SHUTDOWN event
> was triggered by an action I took directly in the guest (shutdown -h),
> at which point qemu stops the vcpus and waits for libvirt to do any
> final cleanups; the second SHUTDOWN event is the result of libvirt
> sending SIGTERM now that it has completed cleanup.
> 
> The replay driver needs a followup patch if we want to be able to
> faithfully replay the difference between a host- and guest-initiated
> shutdown (for now, the replayed event is always attributed to host).
> 
> See also https://bugzilla.redhat.com/1384007
> 
> Signed-off-by: Eric Blake <eblake@redhat.com>

For the SPARC part:

Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>


ATB,

Mark.

  parent reply	other threads:[~2017-05-05  8:37 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     ` [Qemu-devel] " Markus Armbruster
2017-04-28 14:45       ` 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 [this message]
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=1fb98d19-fb1d-831f-7eb1-cabcc15b3884@ilande.co.uk \
    --to=mark.cave-ayland@ilande.co.uk \
    --cc=eblake@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 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.