summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--QMP/README6
-rw-r--r--QMP/qmp-spec.txt6
-rw-r--r--monitor.c10
3 files changed, 17 insertions, 5 deletions
diff --git a/QMP/README b/QMP/README
index 09e7053753..9334c25510 100644
--- a/QMP/README
+++ b/QMP/README
@@ -52,9 +52,11 @@ $ telnet localhost 4444
 Trying 127.0.0.1...
 Connected to localhost.
 Escape character is '^]'.
-{"QMP": {"capabilities": []}}
+{"QMP": {"version": {"qemu": "0.12.50", "package": ""}, "capabilities": []}}
+{ "execute": "qmp_capabilities" }
+{"return": {}}
 { "execute": "query-version" }
-{"return": {"qemu": "0.11.50", "package": ""}}
+{"return": {"qemu": "0.12.50", "package": ""}}
 
 Contact
 -------
diff --git a/QMP/qmp-spec.txt b/QMP/qmp-spec.txt
index 56f388c3b3..b2617bb2f0 100644
--- a/QMP/qmp-spec.txt
+++ b/QMP/qmp-spec.txt
@@ -48,10 +48,12 @@ waiting for commands.
 
 The format is:
 
-{ "QMP": { "capabilities": json-array } }
+{ "QMP": { "version": json-object, "capabilities": json-array } }
 
  Where,
 
+- The "version" member contains the Server's version information (the format
+  is the same of the 'query-version' command)
 - The "capabilities" member specify the availability of features beyond the
   baseline specification
 
@@ -152,7 +154,7 @@ This section provides some examples of real QMP usage, in all of them
 3.1 Server greeting
 -------------------
 
-S: {"QMP": {"capabilities": []}}
+S: {"QMP": {"version": {"qemu": "0.12.50", "package": ""}, "capabilities": []}}
 
 3.2 Simple 'stop' execution
 ---------------------------
diff --git a/monitor.c b/monitor.c
index 19876adbc2..02829a4398 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4368,6 +4368,14 @@ void monitor_resume(Monitor *mon)
         readline_show_prompt(mon->rs);
 }
 
+static QObject *get_qmp_greeting(void)
+{
+    QObject *ver;
+
+    do_info_version(NULL, &ver);
+    return qobject_from_jsonf("{'QMP':{'version': %p,'capabilities': []}}",ver);
+}
+
 /**
  * monitor_control_event(): Print QMP gretting
  */
@@ -4379,7 +4387,7 @@ static void monitor_control_event(void *opaque, int event)
 
         json_message_parser_init(&mon->mc->parser, handle_qmp_command);
 
-        data = qobject_from_jsonf("{ 'QMP': { 'capabilities': [] } }");
+        data = get_qmp_greeting();
         assert(data != NULL);
 
         monitor_json_emitter(mon, data);