From: Markus Armbruster <armbru@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
"open list:Overall" <kvm@vger.kernel.org>,
"Michael S. Tsirkin" <mst@redhat.com>,
Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
qemu-devel@nongnu.org, Cornelia Huck <cornelia.huck@de.ibm.com>,
Gerd Hoffmann <kraxel@redhat.com>, Rob Herring <robh@kernel.org>,
Stefano Stabellini <sstabellini@kernel.org>,
Magnus Damm <magnus.damm@gmail.com>,
Alexander Graf <agraf@suse.de>,
Christian Borntraeger <borntraeger@de.ibm.com>,
Anthony Perard <anthony.perard@citrix.com>,
"open list:X86" <xen-devel@lists.xenproject.org>,
David Gibson <david@gibson.dropbear.id.au>,
Artyom Tarasenko <atar4qemu@gmail.com>,
Eduardo Habkost <ehabkost@redhat.com>,
Stefan Weil <sw@weilnetz.de>,
alistair.francis@xilinx.com,
"open list:Calxeda Highbank" <qemu-arm@nongnu.org>,
Jan Kiszka <jan.kiszka@web.de>,
Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>,
Paolo Bonzini <pbonzini@redhat.com>,
Yongbok Kim <yongbok.kim@imgtec.com>,
Richard Henderson <rth@twiddle.net>,
Paul Burton <paul.burton@imgtec.com>,
Max Filippov <jcmvbkbc@gmail.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
Michael Walle <michael@walle.cc>,
"open list:Old World" <qemu-ppc@nongnu.org>,
Igor Mammedov <imammedo@redhat.com>,
Aurelien Jarno <aurelien@aurel32.net>
Subject: Re: [Qemu-arm] [Qemu-devel] [PATCH v7 3/5] shutdown: Add source information to SHUTDOWN and RESET
Date: Tue, 09 May 2017 13:56:46 +0200 [thread overview]
Message-ID: <87efvyhzfc.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20170508211953.28017-4-eblake@redhat.com> (Eric Blake's message of "Mon, 8 May 2017 16:19:51 -0500")
Resending because first send didn't get through to some recipients...
Eric Blake <eblake@redhat.com> writes:
> Time to wire up all the call sites that request a shutdown or
> reset to use the enum added in the previous patch.
>
> 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 reset requests.
>
> Replay adds a FIXME to preserve the cause across the replay stream,
> that will be tackled in the next patch.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>
> Acked-by: David Gibson <david@gibson.dropbear.id.au> [ppc parts]
> Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> [SPARC part]
[...]
> diff --git a/hw/acpi/core.c b/hw/acpi/core.c
> index e890a5d..95fcac9 100644
> --- a/hw/acpi/core.c
> +++ b/hw/acpi/core.c
> @@ -561,7 +561,7 @@ static void acpi_pm1_cnt_write(ACPIREGS *ar, uint16_t val)
> uint16_t sus_typ = (val >> 10) & 7;
> switch(sus_typ) {
> case 0: /* soft power off */
> - qemu_system_shutdown_request();
> + qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN);
> break;
> case 1:
> qemu_system_suspend_request();
> @@ -569,7 +569,7 @@ static void acpi_pm1_cnt_write(ACPIREGS *ar, uint16_t val)
> default:
> if (sus_typ == ar->pm1.cnt.s4_val) { /* S4 request */
> qapi_event_send_suspend_disk(&error_abort);
> - qemu_system_shutdown_request();
> + qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN);
I'm fine with using SHUTDOWN_CAUSE_GUEST_SHUTDOWN for suspend, but have
you considered SHUTDOWN_CAUSE_GUEST_SUSPEND?
> }
> break;
> }
[...]
> diff --git a/qmp.c b/qmp.c
> index ab74cd7..95949d0 100644
> --- a/qmp.c
> +++ b/qmp.c
> @@ -84,7 +84,7 @@ UuidInfo *qmp_query_uuid(Error **errp)
> void qmp_quit(Error **errp)
> {
> no_shutdown = 0;
> - qemu_system_shutdown_request();
> + qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_QMP);
> }
>
> void qmp_stop(Error **errp)
> @@ -105,7 +105,7 @@ void qmp_stop(Error **errp)
>
> void qmp_system_reset(Error **errp)
> {
> - qemu_system_reset_request();
> + qemu_system_reset_request(SHUTDOWN_CAUSE_HOST_QMP);
This is the only place where we pass something other than
SHUTDOWN_CAUSE_GUEST_RESET. We could avoid churn the obvious way, but I
guess having the churn eases patch review. Okay.
> }
>
> void qmp_system_powerdown(Error **erp)
> diff --git a/replay/replay.c b/replay/replay.c
> index f810628..604fa4f 100644
> --- a/replay/replay.c
> +++ b/replay/replay.c
> @@ -51,7 +51,8 @@ bool replay_next_event_is(int event)
> switch (replay_state.data_kind) {
> case EVENT_SHUTDOWN:
> replay_finish_event();
> - qemu_system_shutdown_request();
> + /* FIXME - store actual reason */
> + qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_ERROR);
The temporary replay breakage is no big deal. Still, can we avoid it by
extending replay first, using a dummy value like
SHUTDOWN_CAUSE_HOST_ERROR until the real cause becomes available? Not
sure it's worth a respin, though.
> break;
> default:
> /* clock, time_t, checkpoint and other events */
[...]
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: Peter Maydell <peter.maydell@linaro.org>,
"open list:Overall" <kvm@vger.kernel.org>,
"Michael S. Tsirkin" <mst@redhat.com>,
Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
qemu-devel@nongnu.org, Cornelia Huck <cornelia.huck@de.ibm.com>,
Gerd Hoffmann <kraxel@redhat.com>,
"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
Rob Herring <robh@kernel.org>,
Stefano Stabellini <sstabellini@kernel.org>,
Magnus Damm <magnus.damm@gmail.com>,
Alexander Graf <agraf@suse.de>,
Christian Borntraeger <borntraeger@de.ibm.com>,
Anthony Perard <anthony.perard@citrix.com>,
"open list:X86" <xen-devel@lists.xenproject.org>,
David Gibson <david@gibson.dropbear.id.au>,
Artyom Tarasenko <atar4qemu@gmail.com>,
Eduardo Habkost <ehabkost@redhat.com>,
Stefan Weil <sw@weilnetz.de>,
alistair.francis@xilinx.com,
"open list:Calxeda Highbank" <qemu-arm@nongnu.org>,
Jan Kiszka <jan.kiszka@web.de>,
Pavel
Subject: Re: [Qemu-devel] [PATCH v7 3/5] shutdown: Add source information to SHUTDOWN and RESET
Date: Tue, 09 May 2017 13:56:46 +0200 [thread overview]
Message-ID: <87efvyhzfc.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20170508211953.28017-4-eblake@redhat.com> (Eric Blake's message of "Mon, 8 May 2017 16:19:51 -0500")
Resending because first send didn't get through to some recipients...
Eric Blake <eblake@redhat.com> writes:
> Time to wire up all the call sites that request a shutdown or
> reset to use the enum added in the previous patch.
>
> 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 reset requests.
>
> Replay adds a FIXME to preserve the cause across the replay stream,
> that will be tackled in the next patch.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>
> Acked-by: David Gibson <david@gibson.dropbear.id.au> [ppc parts]
> Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> [SPARC part]
[...]
> diff --git a/hw/acpi/core.c b/hw/acpi/core.c
> index e890a5d..95fcac9 100644
> --- a/hw/acpi/core.c
> +++ b/hw/acpi/core.c
> @@ -561,7 +561,7 @@ static void acpi_pm1_cnt_write(ACPIREGS *ar, uint16_t val)
> uint16_t sus_typ = (val >> 10) & 7;
> switch(sus_typ) {
> case 0: /* soft power off */
> - qemu_system_shutdown_request();
> + qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN);
> break;
> case 1:
> qemu_system_suspend_request();
> @@ -569,7 +569,7 @@ static void acpi_pm1_cnt_write(ACPIREGS *ar, uint16_t val)
> default:
> if (sus_typ == ar->pm1.cnt.s4_val) { /* S4 request */
> qapi_event_send_suspend_disk(&error_abort);
> - qemu_system_shutdown_request();
> + qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN);
I'm fine with using SHUTDOWN_CAUSE_GUEST_SHUTDOWN for suspend, but have
you considered SHUTDOWN_CAUSE_GUEST_SUSPEND?
> }
> break;
> }
[...]
> diff --git a/qmp.c b/qmp.c
> index ab74cd7..95949d0 100644
> --- a/qmp.c
> +++ b/qmp.c
> @@ -84,7 +84,7 @@ UuidInfo *qmp_query_uuid(Error **errp)
> void qmp_quit(Error **errp)
> {
> no_shutdown = 0;
> - qemu_system_shutdown_request();
> + qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_QMP);
> }
>
> void qmp_stop(Error **errp)
> @@ -105,7 +105,7 @@ void qmp_stop(Error **errp)
>
> void qmp_system_reset(Error **errp)
> {
> - qemu_system_reset_request();
> + qemu_system_reset_request(SHUTDOWN_CAUSE_HOST_QMP);
This is the only place where we pass something other than
SHUTDOWN_CAUSE_GUEST_RESET. We could avoid churn the obvious way, but I
guess having the churn eases patch review. Okay.
> }
>
> void qmp_system_powerdown(Error **erp)
> diff --git a/replay/replay.c b/replay/replay.c
> index f810628..604fa4f 100644
> --- a/replay/replay.c
> +++ b/replay/replay.c
> @@ -51,7 +51,8 @@ bool replay_next_event_is(int event)
> switch (replay_state.data_kind) {
> case EVENT_SHUTDOWN:
> replay_finish_event();
> - qemu_system_shutdown_request();
> + /* FIXME - store actual reason */
> + qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_ERROR);
The temporary replay breakage is no big deal. Still, can we avoid it by
extending replay first, using a dummy value like
SHUTDOWN_CAUSE_HOST_ERROR until the real cause becomes available? Not
sure it's worth a respin, though.
> break;
> default:
> /* clock, time_t, checkpoint and other events */
[...]
Reviewed-by: Markus Armbruster <armbru@redhat.com>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
WARNING: multiple messages have this Message-ID (diff)
From: Markus Armbruster <armbru@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>,
"open list:Overall" <kvm@vger.kernel.org>,
"Michael S. Tsirkin" <mst@redhat.com>,
Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
Alexander Graf <agraf@suse.de>,
Yongbok Kim <yongbok.kim@imgtec.com>,
Gerd Hoffmann <kraxel@redhat.com>,
"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
Rob Herring <robh@kernel.org>,
Stefano Stabellini <sstabellini@kernel.org>,
Magnus Damm <magnus.damm@gmail.com>,
Christian Borntraeger <borntraeger@de.ibm.com>,
Anthony Perard <anthony.perard@citrix.com>,
"open list:X86" <xen-devel@lists.xenproject.org>,
Richard Henderson <rth@twiddle.net>,
Artyom Tarasenko <atar4qemu@gmail.com>,
Eduardo Habkost <ehabkost@redhat.com>,
Stefan Weil <sw@weilnetz.de>,
alistair.francis@xilinx.com,
"open list:Calxeda Highbank" <qemu-arm@nongnu.org>,
Jan Kiszka <jan.kiszka@web.de>,
Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>,
Igor Mammedov <imammedo@redhat.com>,
Cornelia Huck <cornelia.huck@de.ibm.com>,
David Gibson <david@gibson.dropbear.id.au>,
Paul Burton <paul.burton@imgtec.com>,
Max Filippov <jcmvbkbc@gmail.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
Michael Walle <michael@walle.cc>,
"open list:Old World" <qemu-ppc@nongnu.org>,
Paolo Bonzini <pbonzini@redhat.com>,
Aurelien Jarno <aurelien@aurel32.net>
Subject: Re: [Qemu-devel] [PATCH v7 3/5] shutdown: Add source information to SHUTDOWN and RESET
Date: Tue, 09 May 2017 13:56:46 +0200 [thread overview]
Message-ID: <87efvyhzfc.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20170508211953.28017-4-eblake@redhat.com> (Eric Blake's message of "Mon, 8 May 2017 16:19:51 -0500")
Resending because first send didn't get through to some recipients...
Eric Blake <eblake@redhat.com> writes:
> Time to wire up all the call sites that request a shutdown or
> reset to use the enum added in the previous patch.
>
> 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 reset requests.
>
> Replay adds a FIXME to preserve the cause across the replay stream,
> that will be tackled in the next patch.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>
> Acked-by: David Gibson <david@gibson.dropbear.id.au> [ppc parts]
> Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> [SPARC part]
[...]
> diff --git a/hw/acpi/core.c b/hw/acpi/core.c
> index e890a5d..95fcac9 100644
> --- a/hw/acpi/core.c
> +++ b/hw/acpi/core.c
> @@ -561,7 +561,7 @@ static void acpi_pm1_cnt_write(ACPIREGS *ar, uint16_t val)
> uint16_t sus_typ = (val >> 10) & 7;
> switch(sus_typ) {
> case 0: /* soft power off */
> - qemu_system_shutdown_request();
> + qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN);
> break;
> case 1:
> qemu_system_suspend_request();
> @@ -569,7 +569,7 @@ static void acpi_pm1_cnt_write(ACPIREGS *ar, uint16_t val)
> default:
> if (sus_typ == ar->pm1.cnt.s4_val) { /* S4 request */
> qapi_event_send_suspend_disk(&error_abort);
> - qemu_system_shutdown_request();
> + qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN);
I'm fine with using SHUTDOWN_CAUSE_GUEST_SHUTDOWN for suspend, but have
you considered SHUTDOWN_CAUSE_GUEST_SUSPEND?
> }
> break;
> }
[...]
> diff --git a/qmp.c b/qmp.c
> index ab74cd7..95949d0 100644
> --- a/qmp.c
> +++ b/qmp.c
> @@ -84,7 +84,7 @@ UuidInfo *qmp_query_uuid(Error **errp)
> void qmp_quit(Error **errp)
> {
> no_shutdown = 0;
> - qemu_system_shutdown_request();
> + qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_QMP);
> }
>
> void qmp_stop(Error **errp)
> @@ -105,7 +105,7 @@ void qmp_stop(Error **errp)
>
> void qmp_system_reset(Error **errp)
> {
> - qemu_system_reset_request();
> + qemu_system_reset_request(SHUTDOWN_CAUSE_HOST_QMP);
This is the only place where we pass something other than
SHUTDOWN_CAUSE_GUEST_RESET. We could avoid churn the obvious way, but I
guess having the churn eases patch review. Okay.
> }
>
> void qmp_system_powerdown(Error **erp)
> diff --git a/replay/replay.c b/replay/replay.c
> index f810628..604fa4f 100644
> --- a/replay/replay.c
> +++ b/replay/replay.c
> @@ -51,7 +51,8 @@ bool replay_next_event_is(int event)
> switch (replay_state.data_kind) {
> case EVENT_SHUTDOWN:
> replay_finish_event();
> - qemu_system_shutdown_request();
> + /* FIXME - store actual reason */
> + qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_ERROR);
The temporary replay breakage is no big deal. Still, can we avoid it by
extending replay first, using a dummy value like
SHUTDOWN_CAUSE_HOST_ERROR until the real cause becomes available? Not
sure it's worth a respin, though.
> break;
> default:
> /* clock, time_t, checkpoint and other events */
[...]
Reviewed-by: Markus Armbruster <armbru@redhat.com>
next prev parent reply other threads:[~2017-05-09 14:34 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 ` [Qemu-devel] " Markus Armbruster
2017-05-09 11:40 ` 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 ` Markus Armbruster [this message]
2017-05-09 11:56 ` [Qemu-devel] " Markus Armbruster
2017-05-09 11:56 ` Markus Armbruster
2017-05-09 11:56 ` 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 13:57 ` Cornelia Huck
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-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=87efvyhzfc.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=agraf@suse.de \
--cc=alistair.francis@xilinx.com \
--cc=anthony.perard@citrix.com \
--cc=atar4qemu@gmail.com \
--cc=aurelien@aurel32.net \
--cc=borntraeger@de.ibm.com \
--cc=cornelia.huck@de.ibm.com \
--cc=david@gibson.dropbear.id.au \
--cc=eblake@redhat.com \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=jan.kiszka@web.de \
--cc=jcmvbkbc@gmail.com \
--cc=kraxel@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=michael@walle.cc \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.com \
--cc=paul.burton@imgtec.com \
--cc=pavel.dovgaluk@ispras.ru \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=robh@kernel.org \
--cc=rth@twiddle.net \
--cc=sstabellini@kernel.org \
--cc=sw@weilnetz.de \
--cc=xen-devel@lists.xenproject.org \
--cc=yongbok.kim@imgtec.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.