]> Git Repo - qemu.git/commit - tests/qmp-test.c
qmp: introduce QMPCapability
authorPeter Xu <[email protected]>
Fri, 9 Mar 2018 08:59:53 +0000 (16:59 +0800)
committerEric Blake <[email protected]>
Mon, 19 Mar 2018 19:58:37 +0000 (14:58 -0500)
commit02130314d8c71743e6d1fefc2b08a608516bccc7
tree8affa039a7e8eb8b2d04c16a41e1d732b6319a3a
parenta5ed352596a8b7eb2f9acce34371b944ac3056c4
qmp: introduce QMPCapability

There were no QMP capabilities defined.  Define the first capability,
"oob", to allow out-of-band messages.

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 capability that we support):

  { "execute": "qmp_capabilities",
    "arguments": { "enable": [ "oob" ] } }

When the "arguments" key is not provided, no capability is enabled.

For capability "oob", the monitor needs to be run on a dedicated IO
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
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 <[email protected]>
Message-Id: <20180309090006[email protected]>
Reviewed-by: Eric Blake <[email protected]>
[eblake: touch up commit message]
Signed-off-by: Eric Blake <[email protected]>
monitor.c
qapi/misc.json
tests/qmp-test.c
This page took 0.027636 seconds and 4 git commands to generate.