qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 2/3] qapi: split host-qmp into quit and system-reset


From: Dominik Csapak
Subject: [Qemu-devel] [PATCH 2/3] qapi: split host-qmp into quit and system-reset
Date: Wed, 31 Oct 2018 12:52:41 +0100

it is interesting to know whether the shutdown cause was 'quit' or
'reset', especially when using --no-reboot

Signed-off-by: Dominik Csapak <address@hidden>
---
 qapi/run-state.json | 10 ++++++----
 qmp.c               |  4 ++--
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/qapi/run-state.json b/qapi/run-state.json
index 883bed167c..c215b6ef83 100644
--- a/qapi/run-state.json
+++ b/qapi/run-state.json
@@ -68,7 +68,9 @@
 #
 # @host-error: An error prevented further use of guest
 #
-# @host-qmp: Reaction to a QMP command, like 'quit'
+# @host-qmp-quit: Reaction to the QMP command 'quit'
+#
+# @host-qmp-system-reset: Reaction to the QMP command 'system_reset'
 #
 # @host-signal: Reaction to a signal, such as SIGINT
 #
@@ -88,9 +90,9 @@
 #
 ##
 { 'enum': 'ShutdownCause',
-  'data': [ 'none', 'host-error', 'host-qmp', 'host-signal', 'host-ui',
-            'guest-shutdown', 'guest-reset', 'guest-panic',
-            'subsystem-reset'] }
+  'data': [ 'none', 'host-error', 'host-qmp-quit', 'host-qmp-system-reset',
+            'host-signal', 'host-ui', 'guest-shutdown', 'guest-reset',
+            'guest-panic', 'subsystem-reset'] }
 
 ##
 # @StatusInfo:
diff --git a/qmp.c b/qmp.c
index e7c0a2fd60..82298f6cb0 100644
--- a/qmp.c
+++ b/qmp.c
@@ -88,7 +88,7 @@ UuidInfo *qmp_query_uuid(Error **errp)
 void qmp_quit(Error **errp)
 {
     no_shutdown = 0;
-    qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_QMP);
+    qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_QMP_QUIT);
 }
 
 void qmp_stop(Error **errp)
@@ -109,7 +109,7 @@ void qmp_stop(Error **errp)
 
 void qmp_system_reset(Error **errp)
 {
-    qemu_system_reset_request(SHUTDOWN_CAUSE_HOST_QMP);
+    qemu_system_reset_request(SHUTDOWN_CAUSE_HOST_QMP_SYSTEM_RESET);
 }
 
 void qmp_system_powerdown(Error **erp)
-- 
2.11.0





reply via email to

[Prev in Thread] Current Thread [Next in Thread]