All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: qemu-devel@nongnu.org, Kevin Wolf <kwolf@redhat.com>,
	"open list:Block layer core" <qemu-block@nongnu.org>,
	Max Reitz <mreitz@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	alistair.francis@xilinx.com
Subject: Re: [Qemu-devel] [PATCH v9 5/5] shutdown: Expose bool cause in SHUTDOWN and RESET events
Date: Tue, 16 May 2017 10:49:23 +0200	[thread overview]
Message-ID: <87tw4lfap8.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20170515214114.15442-6-eblake@redhat.com> (Eric Blake's message of "Mon, 15 May 2017 16:41:14 -0500")

Eric Blake <eblake@redhat.com> writes:

> 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() was
> already able to give different output to stderr based on 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 to management.  The previous patches improved things to use an
> enum throughout all callsites, so now we have something ready to
> expose through QMP.
>
> Note that for now, the decision was to expose ONLY a boolean,
> rather than promoting ShutdownCause to a QAPI enum; this is because
> libvirt has not expressed an interest in anything finer-grained.
> We can still add additional details, in a backwards-compatible
> manner, if a need later arises (if the addition happens before 2.10,
> we can replace the bool with an enum; otherwise, the enum will have
> to be in addition to the bool); this patch merely adds a helper
> shutdown_caused_by_guest() to map the internal enum into the
> external boolean.
>
> Update expected iotest outputs to match the new data (complete
> coverage of the affected tests is obtained by -raw, -qcow2, and -nbd).
>
> 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-shutdown: 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.  Libvirt is already
> smart enough to only feed the first qemu SHUTDOWN event to the end user
> (remember, virsh qemu-monitor-event is a low-level debugging interface
> that is explicitly unsupported by libvirt, so it sees things that normal
> end users do not); changing qemu to emit SHUTDOWN only once is outside
> the scope of this series.
>
> See also https://bugzilla.redhat.com/1384007
>
> Signed-off-by: Eric Blake <eblake@redhat.com>

Reviewed-by: Markus Armbruster <armbru@redhat.com>

  reply	other threads:[~2017-05-16  8:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-15 21:41 [Qemu-devel] [PATCH v9 0/5] event: Add source information to SHUTDOWN Eric Blake
2017-05-15 21:41 ` [Qemu-devel] [PATCH v9 1/5] shutdown: Simplify shutdown_signal Eric Blake
2017-05-15 21:41 ` [Qemu-devel] [PATCH v9 2/5] shutdown: Prepare for use of an enum in reset/shutdown_request Eric Blake
2017-05-15 21:41   ` Eric Blake
2017-05-16  8:40   ` [Qemu-devel] " Markus Armbruster
2017-05-16  8:40     ` Markus Armbruster
2017-05-15 21:41 ` [Qemu-devel] [PATCH v9 3/5] shutdown: Preserve shutdown cause through replay Eric Blake
2017-05-16  8:43   ` Markus Armbruster
2017-05-15 21:41 ` [PATCH v9 4/5] shutdown: Add source information to SHUTDOWN and RESET Eric Blake
2017-05-15 21:41   ` [Qemu-devel] " Eric Blake
2017-05-15 21:41   ` Eric Blake
2017-05-16  8:46   ` [Qemu-devel] " Markus Armbruster
2017-05-16  8:46     ` Markus Armbruster
2017-05-16  8:46     ` Markus Armbruster
2017-05-16  8:46   ` Markus Armbruster
2017-05-15 21:41 ` Eric Blake
2017-05-15 21:41 ` [Qemu-devel] [PATCH v9 5/5] shutdown: Expose bool cause in SHUTDOWN and RESET events Eric Blake
2017-05-16  8:49   ` Markus Armbruster [this message]
2017-05-16 11:43 ` [Qemu-devel] [PATCH v9 0/5] event: Add source information to SHUTDOWN Markus Armbruster

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=87tw4lfap8.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=alistair.francis@xilinx.com \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --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.