From ecd7a0d5bbfbbb6922dfe4049227256d1eafa3b8 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Wed, 5 Dec 2018 12:01:30 +0100 Subject: qmp: Add reason to SHUTDOWN and RESET events This makes it possible to determine what the exact reason was for a RESET or a SHUTDOWN. A management layer might need the specific reason of those events to determine which cleanups or other actions it needs to do. This patch also updates the iotests to the new expected output that includes the reason. Signed-off-by: Dominik Csapak Message-Id: <20181205110131.23049-3-d.csapak@proxmox.com> Reviewed-by: Markus Armbruster [Commit message tweaked] Signed-off-by: Markus Armbruster --- qapi/run-state.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'qapi') diff --git a/qapi/run-state.json b/qapi/run-state.json index de7725b..436ba4e 100644 --- a/qapi/run-state.json +++ b/qapi/run-state.json @@ -141,6 +141,8 @@ # a guest-initiated ACPI shutdown request or other hardware-specific action) # rather than a host request (such as sending qemu a SIGINT). (since 2.10) # +# @reason: The @ShutdownCause which resulted in the SHUTDOWN. (since 4.0) +# # Note: If the command-line option "-no-shutdown" has been specified, qemu will # not exit, and a STOP event will eventually follow the SHUTDOWN event # @@ -152,7 +154,7 @@ # "timestamp": { "seconds": 1267040730, "microseconds": 682951 } } # ## -{ 'event': 'SHUTDOWN', 'data': { 'guest': 'bool' } } +{ 'event': 'SHUTDOWN', 'data': { 'guest': 'bool', 'reason': 'ShutdownCause' } } ## # @POWERDOWN: @@ -180,6 +182,8 @@ # rather than a host request (such as the QMP command system_reset). # (since 2.10) # +# @reason: The @ShutdownCause of the RESET. (since 4.0) +# # Since: 0.12.0 # # Example: @@ -188,7 +192,7 @@ # "timestamp": { "seconds": 1267041653, "microseconds": 9518 } } # ## -{ 'event': 'RESET', 'data': { 'guest': 'bool' } } +{ 'event': 'RESET', 'data': { 'guest': 'bool', 'reason': 'ShutdownCause' } } ## # @STOP: -- cgit v1.1