From: Luiz Capitulino Date: Fri, 18 Dec 2009 15:25:00 +0000 (-0200) Subject: QMP: Return an empty dict by default X-Git-Tag: v0.12.0~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3733a1e804db3de881b20c9b7abefa60b419113b;p=thirdparty%2Fqemu.git 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 Signed-off-by: Anthony Liguori (cherry picked from commit e38fb11b5099db8de8d60d536d4a01610ee4c08b) --- diff --git a/monitor.c b/monitor.c index f4d77e2dd22..129badcd1ac 100644 --- a/monitor.c +++ b/monitor.c @@ -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 */