mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-11 16:00:50 -07:00
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>
This commit is contained in:
parent
43e713ce93
commit
0abc657914
1 changed files with 2 additions and 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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue