[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v8 6/8] pvpanic: Emit GUEST_PVSHUTDOWN QMP event on pvpanic shutd
From: |
Thomas Weißschuh |
Subject: |
[PATCH v8 6/8] pvpanic: Emit GUEST_PVSHUTDOWN QMP event on pvpanic shutdown signal |
Date: |
Mon, 27 May 2024 08:27:52 +0200 |
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 f8773f23b298..5ac0fec85236 100644
--- a/qapi/run-state.json
+++ b/qapi/run-state.json
@@ -462,6 +462,20 @@
{ 'event': 'GUEST_CRASHLOADED',
'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } }
+##
+# @GUEST_PVSHUTDOWN:
+#
+# Emitted when guest submits a shutdown request via pvpanic interface
+#
+# Since: 9.1
+#
+# Example:
+#
+# <- { "event": "GUEST_PVSHUTDOWN",
+# "timestamp": { "seconds": 1648245259, "microseconds": 893771 } }
+##
+{ 'event': 'GUEST_PVSHUTDOWN' }
+
##
# @GuestPanicAction:
#
diff --git a/system/runstate.c b/system/runstate.c
index 83055f327831..c149b1ab4ba6 100644
--- a/system/runstate.c
+++ b/system/runstate.c
@@ -587,6 +587,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.45.1
- [PATCH v8 0/8] update linux headers to v6.10-rc1 and shutdown support for pvpanic, Thomas Weißschuh, 2024/05/27
- [PATCH v8 3/8] hw/misc/pvpanic: centralize definition of supported events, Thomas Weißschuh, 2024/05/27
- [PATCH v8 2/8] linux-headers: update to 6.10-rc1, Thomas Weißschuh, 2024/05/27
- [PATCH v8 4/8] tests/qtest/pvpanic: use centralized definition of supported events, Thomas Weißschuh, 2024/05/27
- [PATCH v8 7/8] tests/qtest/pvpanic: add tests for pvshutdown event, Thomas Weißschuh, 2024/05/27
- [PATCH v8 5/8] hw/misc/pvpanic: add support for normal shutdowns, Thomas Weißschuh, 2024/05/27
- [PATCH v8 1/8] scripts/update-linux-headers: Copy setup_data.h to correct directory, Thomas Weißschuh, 2024/05/27
- [PATCH v8 8/8] Revert "docs/specs/pvpanic: mark shutdown event as not implemented", Thomas Weißschuh, 2024/05/27
- [PATCH v8 6/8] pvpanic: Emit GUEST_PVSHUTDOWN QMP event on pvpanic shutdown signal,
Thomas Weißschuh <=