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 --- vl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vl.c') diff --git a/vl.c b/vl.c index 2a8b2ee16d..4152e2d3c0 100644 --- a/vl.c +++ b/vl.c @@ -1675,7 +1675,7 @@ void qemu_system_reset(ShutdownCause reason) qemu_devices_reset(); } if (reason != SHUTDOWN_CAUSE_SUBSYSTEM_RESET) { - qapi_event_send_reset(shutdown_caused_by_guest(reason)); + qapi_event_send_reset(shutdown_caused_by_guest(reason), reason); } cpu_synchronize_all_post_reset(); } @@ -1846,7 +1846,7 @@ static bool main_loop_should_exit(void) request = qemu_shutdown_requested(); if (request) { qemu_kill_report(); - qapi_event_send_shutdown(shutdown_caused_by_guest(request)); + qapi_event_send_shutdown(shutdown_caused_by_guest(request), request); if (no_shutdown) { vm_stop(RUN_STATE_SHUTDOWN); } else { -- cgit v1.2.3