On 03/09/2018 02:59 AM, Peter Xu wrote:
There were no QMP capabilities defined. Define the first "oob" as capability to allow out-of-band messages.
Reads better as "Define the first capability, "oob", to allow..."
After this patch, we will allow QMP clients to enable QMP capabilities when sending the first "qmp_capabilities" command. Originally we are starting QMP session with no arguments like: { "execute": "qmp_capabilities" } Now we can enable some QMP capabilities using (take OOB as example, which is the only one capability that we support): { "execute": "qmp_capabilities", "argument": { "enable": [ "oob" ] } }
s/argument/arguments/
When the "argument" key is not provided, no capability is enabled.
again. Also when "arguments":{} is provided with an empty dict, or even with "arguments":{"enable":[]} an empty enable array. But no need to mention them here.
For capability "oob", the monitor needs to be run on dedicated IO
s/on/on a/
thread, otherwise the command will fail. For example, trying to enable OOB on a MUXed typed QMP monitor will fail. One thing to mention is that, QMP capabilities are per-monitor, and also
s/that,/that/
when the connection is closed due to some reason, the capabilities will be reset. Also, touch up qmp-test.c to test the new bits. Signed-off-by: Peter Xu <pet...@redhat.com> --- monitor.c | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++---- qapi/misc.json | 32 ++++++++++++++++++++--- tests/qmp-test.c | 10 +++++++- 3 files changed, 110 insertions(+), 9 deletions(-)
Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org