From: Wenchao Xia Date: Wed, 18 Jun 2014 06:43:33 +0000 (+0200) Subject: qapi event: convert SHUTDOWN X-Git-Tag: qemu-xen-4.6.0-rc1~358^2~28 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=8432183137c4ae91e63e36a683fa0869b3db768e;p=qemu-xen.git qapi event: convert SHUTDOWN This patch also eliminates build time warning caused by QAPI_EVENT_MAX = 0. Signed-off-by: Wenchao Xia Signed-off-by: Paolo Bonzini Reviewed-by: Eric Blake Signed-off-by: Luiz Capitulino --- diff --git a/docs/qmp/qmp-events.txt b/docs/qmp/qmp-events.txt index 22fea580a9..c16d6f19af 100644 --- a/docs/qmp/qmp-events.txt +++ b/docs/qmp/qmp-events.txt @@ -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 ----------------------------------- diff --git a/qapi-event.json b/qapi-event.json index e69de29bb2..7a6e6bf7d4 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 ab8f15243b..1d82b12dbf 100644 --- 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 {