Patchwork [2/2] QMP: Add a warning to the greeting message

login
register
mail settings
Submitter Luiz Capitulino
Date July 22, 2010, 2:47 p.m.
Message ID <1279810021-11875-3-git-send-email-lcapitulino@redhat.com>
Download mbox | patch
Permalink /patch/59580/
State New
Headers show

Comments

Luiz Capitulino - July 22, 2010, 2:47 p.m.
This commit add the following new key to QMP's greeting message:

  "warning": "QMP is unstable, it will change soon!"

The goal is to go beyond document warnings with regard to QMP's
current state.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 QMP/README |    2 +-
 monitor.c  |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

Patch

diff --git a/QMP/README b/QMP/README
index 8618c6f..cf158d2 100644
--- a/QMP/README
+++ b/QMP/README
@@ -61,7 +61,7 @@  $ telnet localhost 4444
 Trying 127.0.0.1...
 Connected to localhost.
 Escape character is '^]'.
-{"QMP": {"version": {"qemu": "0.12.50", "package": ""}, "capabilities": []}}
+{"QMP": {"version": {"qemu": "0.12.50", "package": ""}, "capabilities": [], "warning": "QMP is unstable, it will change soon!"}}
 { "execute": "qmp_capabilities" }
 {"return": {}}
 { "execute": "query-version" }
diff --git a/monitor.c b/monitor.c
index 45fd482..c259b28 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4384,7 +4384,8 @@  static QObject *get_qmp_greeting(void)
     QObject *ver;
 
     do_info_version(NULL, &ver);
-    return qobject_from_jsonf("{'QMP':{'version': %p,'capabilities': []}}",ver);
+    return qobject_from_jsonf("{ 'QMP': { 'version': %p, 'capabilities': [], "
+            "'warning': 'QMP is unstable, it will change soon!' } }", ver);
 }
 
 /**