]> git.proxmox.com Git - mirror_qemu.git/commitdiff
qapi event: convert SHUTDOWN
authorWenchao Xia <wenchaoqemu@gmail.com>
Wed, 18 Jun 2014 06:43:33 +0000 (08:43 +0200)
committerLuiz Capitulino <lcapitulino@redhat.com>
Mon, 23 Jun 2014 15:01:25 +0000 (11:01 -0400)
This patch also eliminates build time warning caused by
QAPI_EVENT_MAX = 0.

Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
docs/qmp/qmp-events.txt
qapi-event.json
vl.c

index 22fea580a95c285277c07cf05c150af3ae7694af..c16d6f19afd88ba45c891cd3cdb906e6250a65de 100644 (file)
@@ -314,21 +314,6 @@ Example:
     "data": { "offset": 78 },
     "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
 
-SHUTDOWN
---------
-
-Emitted when the Virtual Machine is powered down.
-
-Data: None.
-
-Example:
-
-{ "event": "SHUTDOWN",
-    "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
-
-Note: If the command-line option "-no-shutdown" has been specified, a STOP
-event will eventually follow the SHUTDOWN event.
-
 SPICE_CONNECTED, SPICE_DISCONNECTED
 -----------------------------------
 
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..7a6e6bf7d4313df9d07e9d44c38ef8b58bbd0a1d 100644 (file)
@@ -0,0 +1,12 @@
+##
+# @SHUTDOWN
+#
+# Emitted when the virtual machine has shutdown, possibly indicating that QEMU
+# is about about to exit.
+#
+# 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
+#
+# Since: 0.12.0
+##
+{ 'event': 'SHUTDOWN' }
diff --git a/vl.c b/vl.c
index ab8f15243b1a95b8633702aec76519036b231717..1d82b12dbf7fe8e864ae5b01f33fa6da13e1bc42 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -117,6 +117,8 @@ int main(int argc, char **argv)
 #include "ui/qemu-spice.h"
 #include "qapi/string-input-visitor.h"
 #include "qapi/opts-visitor.h"
+#include "qom/object_interfaces.h"
+#include "qapi-event.h"
 
 #define DEFAULT_RAM_SIZE 128
 
@@ -1962,7 +1964,7 @@ static bool main_loop_should_exit(void)
     }
     if (qemu_shutdown_requested()) {
         qemu_kill_report();
-        monitor_protocol_event(QEVENT_SHUTDOWN, NULL);
+        qapi_event_send_shutdown(&error_abort);
         if (no_shutdown) {
             vm_stop(RUN_STATE_SHUTDOWN);
         } else {