[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 13/40] qapi event: convert SHUTDOWN
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PULL 13/40] qapi event: convert SHUTDOWN |
Date: |
Thu, 19 Jun 2014 15:39:25 -0400 |
From: Wenchao Xia <address@hidden>
This patch also eliminates build time warning caused by
QAPI_EVENT_MAX = 0.
Signed-off-by: Wenchao Xia <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>
---
docs/qmp/qmp-events.txt | 15 ---------------
qapi-event.json | 12 ++++++++++++
vl.c | 3 ++-
3 files changed, 14 insertions(+), 16 deletions(-)
diff --git a/docs/qmp/qmp-events.txt b/docs/qmp/qmp-events.txt
index 145402e..ff2f30d 100644
--- a/docs/qmp/qmp-events.txt
+++ b/docs/qmp/qmp-events.txt
@@ -304,21 +304,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
-----------------------------------
diff --git a/qapi-event.json b/qapi-event.json
index e69de29..7a6e6bf 100644
--- a/qapi-event.json
+++ b/qapi-event.json
@@ -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 be69c7f..4dc21d3 100644
--- a/vl.c
+++ b/vl.c
@@ -117,6 +117,7 @@ int main(int argc, char **argv)
#include "ui/qemu-spice.h"
#include "qapi/string-input-visitor.h"
#include "qom/object_interfaces.h"
+#include "qapi-event.h"
#define DEFAULT_RAM_SIZE 128
@@ -2028,7 +2029,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 {
--
1.9.3
- [Qemu-devel] [PULL 08/40] qapi script: add event support, (continued)
- [Qemu-devel] [PULL 08/40] qapi script: add event support, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 05/40] os-posix: include sys/time.h, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 09/40] test: add test cases for qapi event, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 04/40] json-lexer: fix escaped backslash in single-quoted string, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 07/40] qapi: add event helper functions, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 11/40] monitor: add an implemention of qapi event emit method, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 10/40] qapi: adjust existing defines, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 14/40] qapi event: convert POWERDOWN, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 15/40] qapi event: convert RESET, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 17/40] qapi event: convert RESUME, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 13/40] qapi event: convert SHUTDOWN,
Luiz Capitulino <=
- [Qemu-devel] [PULL 19/40] qapi event: convert SUSPEND_DISK, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 20/40] qapi event: convert WAKEUP, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 18/40] qapi event: convert SUSPEND, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 21/40] qapi event: convert RTC_CHANGE, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 16/40] qapi event: convert STOP, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 23/40] qapi event: convert DEVICE_DELETED, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 22/40] qapi event: convert WATCHDOG, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 24/40] qapi event: convert DEVICE_TRAY_MOVED, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 25/40] qapi event: convert BLOCK_IO_ERROR and BLOCK_JOB_ERROR, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 26/40] qapi event: convert BLOCK_IMAGE_CORRUPTED, Luiz Capitulino, 2014/06/19