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,
	Stefano Stabellini <sstabellini@kernel.org>,
	Eduardo Habkost <ehabkost@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Juan Quintela <quintela@redhat.com>,
	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>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH v7 2/5] shutdown: Prepare for use of an enum in reset/shutdown_request
Date: Tue, 09 May 2017 13:40:37 +0200	[thread overview]
Message-ID: <87wp9qp8ay.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20170508211953.28017-3-eblake@redhat.com> (Eric Blake's message of "Mon, 8 May 2017 16:19:50 -0500")

Eric Blake <eblake@redhat.com> writes:

> 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 an internal enum ShutdownCause that describes reasons
> that a shutdown can be requested, and changes qemu_system_reset() to
> pass the reason through, although for now nothing is actually changed
> with regards to what gets reported.  The enum could be exported via
> QAPI at a later date, if deemed necessary, but for now, there has not
> been a request to expose that much detail to end clients.
>
> For the most part, we turn 0 into SHUTDOWN_CAUSE_NONE, and 1 into
> SHUTDOWN_CAUSE_HOST_ERROR; the only specific case where we have enough
> information right now to use a different value is when we are reacting
> to a host signal.  It will take a further patch to edit all call-sites
> that can trigger a reset or shutdown request to properly pass in any
> other reasons; this patch includes FIXMEs to point such places out.

If you need to respin the patch for some other reason, consider
replacing FIXME by TODO, because nothing's actually broken here.

>
> qemu_system_reset() trades its 'bool report' parameter for a
> 'ShutdownCause reason', with all non-zero values having the same
> effect; this lets us get rid of the weird #defines for VMRESET_*
> as synonyms for bools.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>

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

WARNING: multiple messages have this Message-ID (diff)
From: Markus Armbruster <armbru@redhat.com>
To: Eric Blake <eblake@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>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	zhanghailiang <zhang.zhanghailiang@huawei.com>
Subject: Re: [Qemu-devel] [PATCH v7 2/5] shutdown: Prepare for use of an enum in reset/shutdown_request
Date: Tue, 09 May 2017 13:40:37 +0200	[thread overview]
Message-ID: <87wp9qp8ay.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20170508211953.28017-3-eblake@redhat.com> (Eric Blake's message of "Mon, 8 May 2017 16:19:50 -0500")

Eric Blake <eblake@redhat.com> writes:

> 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 an internal enum ShutdownCause that describes reasons
> that a shutdown can be requested, and changes qemu_system_reset() to
> pass the reason through, although for now nothing is actually changed
> with regards to what gets reported.  The enum could be exported via
> QAPI at a later date, if deemed necessary, but for now, there has not
> been a request to expose that much detail to end clients.
>
> For the most part, we turn 0 into SHUTDOWN_CAUSE_NONE, and 1 into
> SHUTDOWN_CAUSE_HOST_ERROR; the only specific case where we have enough
> information right now to use a different value is when we are reacting
> to a host signal.  It will take a further patch to edit all call-sites
> that can trigger a reset or shutdown request to properly pass in any
> other reasons; this patch includes FIXMEs to point such places out.

If you need to respin the patch for some other reason, consider
replacing FIXME by TODO, because nothing's actually broken here.

>
> qemu_system_reset() trades its 'bool report' parameter for a
> 'ShutdownCause reason', with all non-zero values having the same
> effect; this lets us get rid of the weird #defines for VMRESET_*
> as synonyms for bools.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>

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

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

  reply	other threads:[~2017-05-09 11:40 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-08 21:19 [Qemu-devel] [PATCH v7 0/5] event: Add source information to SHUTDOWN Eric Blake
2017-05-08 21:19 ` [Qemu-devel] [PATCH v7 1/5] shutdown: Simplify shutdown_signal Eric Blake
2017-05-08 21:19 ` [Qemu-devel] [PATCH v7 2/5] shutdown: Prepare for use of an enum in reset/shutdown_request Eric Blake
2017-05-08 21:19   ` Eric Blake
2017-05-09 11:40   ` Markus Armbruster [this message]
2017-05-09 11:40     ` [Qemu-devel] " Markus Armbruster
2017-05-08 21:19 ` [PATCH v7 3/5] shutdown: Add source information to SHUTDOWN and RESET Eric Blake
2017-05-08 21:19   ` [Qemu-devel] " Eric Blake
2017-05-08 21:19   ` Eric Blake
2017-05-09 11:56   ` [Qemu-devel] " Markus Armbruster
2017-05-09 14:07     ` Eric Blake
2017-05-09 14:07     ` Eric Blake
2017-05-09 14:07       ` Eric Blake
2017-05-09 14:07       ` Eric Blake
2017-05-10 14:44       ` [Qemu-arm] " Markus Armbruster
2017-05-10 14:44         ` Markus Armbruster
2017-05-10 14:44         ` Markus Armbruster
2017-05-10 14:44       ` Markus Armbruster
2017-05-09 11:56   ` [Qemu-arm] " Markus Armbruster
2017-05-09 11:56     ` Markus Armbruster
2017-05-09 11:56     ` Markus Armbruster
2017-05-09 13:57   ` Cornelia Huck
2017-05-09 13:57     ` [Qemu-devel] " Cornelia Huck
2017-05-09 13:57     ` Cornelia Huck
2017-05-09 13:57   ` Cornelia Huck
2017-05-08 21:19 ` Eric Blake
2017-05-08 21:19 ` [Qemu-devel] [PATCH v7 4/5] shutdown: Preserve shutdown cause through replay Eric Blake
2017-05-10 10:04   ` Pavel Dovgalyuk
2017-05-08 21:19 ` [Qemu-devel] [PATCH v7 5/5] shutdown: Expose bool cause in SHUTDOWN and RESET events Eric Blake
2017-05-09 12:07   ` Markus Armbruster
2017-05-09 14:18     ` Eric Blake
2017-05-09 15:03       ` 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=87wp9qp8ay.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.