From: "Thomas Weißschuh" <thomas@t-8ch.de>
To: "Michael S. Tsirkin" <mst@redhat.com>,
Cornelia Huck <cohuck@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Thomas Huth <thuth@redhat.com>,
Laurent Vivier <lvivier@redhat.com>
Cc: qemu-devel@nongnu.org,
"Alejandro Jimenez" <alejandro.j.jimenez@oracle.com>,
"Thomas Weißschuh" <thomas@t-8ch.de>
Subject: [PATCH v5 5/6] pvpanic: Emit GUEST_PVSHUTDOWN QMP event on pvpanic shutdown signal
Date: Mon, 29 Jan 2024 20:28:13 +0100 [thread overview]
Message-ID: <20240129-pvpanic-shutdown-v5-5-f5a060b87c74@t-8ch.de> (raw)
In-Reply-To: <20240129-pvpanic-shutdown-v5-0-f5a060b87c74@t-8ch.de>
From: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
Emit a QMP event on receiving a PVPANIC_SHUTDOWN event. Even though a typical
SHUTDOWN event will be sent, it will be indistinguishable from a shutdown
originating from other cases (e.g. KVM exit due to KVM_SYSTEM_EVENT_SHUTDOWN)
that also issue the guest-shutdown cause.
A management layer application can detect the new GUEST_PVSHUTDOWN event to
determine if the guest is using the pvpanic interface to request shutdowns.
Signed-off-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
---
qapi/run-state.json | 14 ++++++++++++++
system/runstate.c | 1 +
2 files changed, 15 insertions(+)
diff --git a/qapi/run-state.json b/qapi/run-state.json
index 08bc99cb8561..d5a63e14ba7e 100644
--- a/qapi/run-state.json
+++ b/qapi/run-state.json
@@ -460,6 +460,20 @@
{ 'event': 'GUEST_CRASHLOADED',
'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } }
+##
+# @GUEST_PVSHUTDOWN:
+#
+# Emitted when guest submits a shutdown request via pvpanic interface
+#
+# Since: 8.3
+#
+# Example:
+#
+# <- { "event": "GUEST_PVSHUTDOWN",
+# "timestamp": { "seconds": 1648245259, "microseconds": 893771 } }
+##
+{ 'event': 'GUEST_PVSHUTDOWN' }
+
##
# @GuestPanicAction:
#
diff --git a/system/runstate.c b/system/runstate.c
index 572499513034..02b0a1f8b9d0 100644
--- a/system/runstate.c
+++ b/system/runstate.c
@@ -574,6 +574,7 @@ void qemu_system_guest_crashloaded(GuestPanicInformation *info)
void qemu_system_guest_pvshutdown(void)
{
+ qapi_event_send_guest_pvshutdown();
qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN);
}
--
2.43.0
next prev parent reply other threads:[~2024-01-29 19:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-29 19:28 [PATCH v5 0/6] hw/misc/pvpanic: add support for normal shutdowns Thomas Weißschuh
2024-01-29 19:28 ` [PATCH v5 1/6] linux-headers: drop pvpanic.h Thomas Weißschuh
2024-01-29 19:28 ` [PATCH v5 2/6] hw/misc/pvpanic: centralize definition of supported events Thomas Weißschuh
2024-01-29 19:28 ` [PATCH v5 3/6] tests/qtest/pvpanic: use centralized " Thomas Weißschuh
2024-01-29 19:28 ` [PATCH v5 4/6] hw/misc/pvpanic: add support for normal shutdowns Thomas Weißschuh
2024-01-29 19:28 ` Thomas Weißschuh [this message]
2024-01-29 19:28 ` [PATCH v5 6/6] tests/qtest/pvpanic: add tests for pvshutdown event Thomas Weißschuh
2024-01-30 6:58 ` Thomas Huth
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=20240129-pvpanic-shutdown-v5-5-f5a060b87c74@t-8ch.de \
--to=thomas@t-8ch.de \
--cc=alejandro.j.jimenez@oracle.com \
--cc=cohuck@redhat.com \
--cc=lvivier@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).