Commit 84321831 authored by Wenchao Xia's avatar Wenchao Xia Committed by Luiz Capitulino
Browse files

qapi event: convert SHUTDOWN



This patch also eliminates build time warning caused by
QAPI_EVENT_MAX = 0.

Signed-off-by: default avatarWenchao Xia <wenchaoqemu@gmail.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
Signed-off-by: default avatarLuiz Capitulino <lcapitulino@redhat.com>
parent f668470f
Loading
Loading
Loading
Loading
+0 −15
Original line number Diff line number Diff line
@@ -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
-----------------------------------

+12 −0
Original line number Diff line number Diff line
##
# @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' }
+3 −1
Original line number Diff line number Diff line
@@ -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 {