summaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2010-02-04 18:10:04 -0200
committerAnthony Liguori <aliguori@us.ibm.com>2010-02-10 12:46:05 -0600
commitca9567e23454ca94e3911710da4e953ad049b40f (patch)
treeba992b0a1c9ca87f2916b77ca7cda2078c6a4b70 /monitor.c
parent4ab4183d766f10f9fc35cd9ef4acee39f241986f (diff)
downloadqemu-ca9567e23454ca94e3911710da4e953ad049b40f.tar.gz
qemu-ca9567e23454ca94e3911710da4e953ad049b40f.tar.bz2
qemu-ca9567e23454ca94e3911710da4e953ad049b40f.zip
QMP: Add QEMU's version to the greeting message
With capability negotiation support clients will only have a chance to check QEMU's version (ie. issue 'query-version') after the negotiation procedure is done. It might be useful to clients to check QEMU's version before negotiating features, though. To allow that, this commit adds the QEMU's version object to the greeting message. Not really sure this is needed, but doesn't hurt anyway. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c10
1 files changed, 9 insertions, 1 deletions
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);