diff mbox

[V6,11/29] qapi event: convert STOP

Message ID 1401970944-18735-12-git-send-email-wenchaoqemu@gmail.com
State New
Headers show

Commit Message

Wenchao Xia June 5, 2014, 12:22 p.m. UTC
Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com>
---
 cpus.c                  |    5 +++--
 docs/qmp/qmp-events.txt |   12 ------------
 qapi-event.json         |    9 +++++++++
 3 files changed, 12 insertions(+), 14 deletions(-)

Comments

Eric Blake June 13, 2014, 8:29 p.m. UTC | #1
On 06/05/2014 06:22 AM, Wenchao Xia wrote:
> Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com>
> ---
>  cpus.c                  |    5 +++--
>  docs/qmp/qmp-events.txt |   12 ------------
>  qapi-event.json         |    9 +++++++++
>  3 files changed, 12 insertions(+), 14 deletions(-)
> 

> @@ -530,7 +531,7 @@ static int do_vm_stop(RunState state)
>          pause_all_vcpus();
>          runstate_set(state);
>          vm_state_notify(0, state);
> -        monitor_protocol_event(QEVENT_STOP, NULL);
> +        qapi_event_send_stop(NULL);

Same comments from earlier about not needing errp argument

> +++ b/qapi-event.json
> @@ -29,3 +29,12 @@
>  # Since: 2.1
>  ##
>  { 'event': 'RESET' }
> +
> +##
> +# @STOP
> +#
> +# Emitted when the virtual machine is stopped
> +#
> +# Since: 2.1

0.14.0
Paolo Bonzini June 17, 2014, 9:17 a.m. UTC | #2
Il 13/06/2014 22:29, Eric Blake ha scritto:
>> > +#
>> > +# Emitted when the virtual machine is stopped
>> > +#
>> > +# Since: 2.1
> 0.14.0

0.12.0, actually:

$ git describe --contains b1a15e7eaafba8f26e2263b1a9b6e6d40e585e72
v0.12.0-rc0~187

Paolo
Eric Blake June 17, 2014, 1:18 p.m. UTC | #3
On 06/17/2014 03:17 AM, Paolo Bonzini wrote:
> Il 13/06/2014 22:29, Eric Blake ha scritto:
>>> > +#
>>> > +# Emitted when the virtual machine is stopped
>>> > +#
>>> > +# Since: 2.1
>> 0.14.0
> 
> 0.12.0, actually:
> 
> $ git describe --contains b1a15e7eaafba8f26e2263b1a9b6e6d40e585e72
> v0.12.0-rc0~187

But nothing else in qapi-schema.json mentions anything earlier than
0.14.  True, QMP was first started in the 0.12 timeframe, but upstream
libvirt refuses to use QMP for anything earlier than qemu 0.15, unless
libvirt was able to probe that enough additional functionality of QMP
was backported to make it useful (thus it supports RHEL 6's qemu 0.12+).
diff mbox

Patch

diff --git a/cpus.c b/cpus.c
index dd7ac13..28abb11 100644
--- a/cpus.c
+++ b/cpus.c
@@ -25,7 +25,7 @@ 
 /* Needed early for CONFIG_BSD etc. */
 #include "config-host.h"
 
-#include "monitor/monitor.h"
+#include "qapi/qmp/qerror.h"
 #include "sysemu/sysemu.h"
 #include "exec/gdbstub.h"
 #include "sysemu/dma.h"
@@ -38,6 +38,7 @@ 
 #include "qemu/main-loop.h"
 #include "qemu/bitmap.h"
 #include "qemu/seqlock.h"
+#include "qapi-event.h"
 
 #ifndef _WIN32
 #include "qemu/compatfd.h"
@@ -530,7 +531,7 @@  static int do_vm_stop(RunState state)
         pause_all_vcpus();
         runstate_set(state);
         vm_state_notify(0, state);
-        monitor_protocol_event(QEVENT_STOP, NULL);
+        qapi_event_send_stop(NULL);
     }
 
     bdrv_drain_all();
diff --git a/docs/qmp/qmp-events.txt b/docs/qmp/qmp-events.txt
index 20e3151..c241a07 100644
--- a/docs/qmp/qmp-events.txt
+++ b/docs/qmp/qmp-events.txt
@@ -354,18 +354,6 @@  Example:
                       "channel-id": 0, "tls": true}
 }}
 
-STOP
-----
-
-Emitted when the Virtual Machine is stopped.
-
-Data: None.
-
-Example:
-
-{ "event": "STOP",
-    "timestamp": { "seconds": 1267041730, "microseconds": 281295 } }
-
 SUSPEND
 -------
 
diff --git a/qapi-event.json b/qapi-event.json
index 6f27555..af5a18c 100644
--- a/qapi-event.json
+++ b/qapi-event.json
@@ -29,3 +29,12 @@ 
 # Since: 2.1
 ##
 { 'event': 'RESET' }
+
+##
+# @STOP
+#
+# Emitted when the virtual machine is stopped
+#
+# Since: 2.1
+##
+{ 'event': 'STOP' }