diff options
author | Luiz Capitulino <lcapitulino@redhat.com> | 2009-12-18 13:25:00 -0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-12-19 08:26:02 -0600 |
commit | 0abc657914c73c74a7381a26dd45d138a4b3bdd7 (patch) | |
tree | 5e8e044090c6f3fe64182d8f32177ffc7878f1ba /monitor.c | |
parent | 43e713ce93600ccdb4dd0cc54ff5a087b38eb91e (diff) |
QMP: Return an empty dict by default
Currently, when a regular command doesn't have any data to output,
QMP will emit:
{ "return": "OK" }
Returning an empty dict is better though, because dicts can support
some protocol changes in a compatible way.
So, with this commit we will return:
{ "return": {} }
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.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -286,7 +286,8 @@ static void monitor_protocol_emitter(Monitor *mon, QObject *data) qobject_incref(data); qdict_put_obj(qmp, "return", data); } else { - qdict_put(qmp, "return", qstring_from_str("OK")); + /* return an empty QDict by default */ + qdict_put(qmp, "return", qdict_new()); } } else { /* error response */ |