QMP: Output support
In the new Monitor output is always performed by only two functions: do_info() and monitor_call_handler(). To support QMP output, we modify those functions to check if we are in control mode. If so, we call monitor_protocol_emitter() to emit QMP output, otherwise we do regular output. QMP has two types of responses to issued commands: success and error. The outputed data is always a JSON object. Success responses have the following format: { "return": json-value, "id": json-value } Error responses have the following format: { "error": { "class": json-string, "desc": json-string, "data": json-value } "id": json-value } Please, note that the "id" key is part of the input code, and thus is not added in this commit. Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
Showing
想要评论请 注册 或 登录