mirror_qemu/qapi
Markus Armbruster 97ca0712c8 qmp: Get rid of x-oob-test command
tests/qmp-test tests an out-of-band command overtaking a slow in-band
command.  To do that, it needs:

1. An in-band command that *reliably* takes long enough to be
   overtaken.

2. An out-of-band command to do the overtaking.

3. To avoid delays, a way to make the in-band command complete quickly
   after it was overtaken.

To satisfy these needs, commit 469638f9cb provides the rather
peculiar oob-capable QMP command x-oob-test:

* With "lock": true, it waits for a global semaphore.

* With "lock": false, it signals the global semaphore.

To satisfy 1., the test runs x-oob-test in-band with "lock": true.
To satisfy 2. and 3., it runs x-oob-test out-of-band with "lock": false.

Note that waiting for a semaphore violates the rules for oob-capable
commands.  Running x-oob-test with "lock": true hangs the monitor
until you run x-oob-test with "lock": false on another monitor (which
you might not have set up).

Having an externally visible QMP command that may hang the monitor is
not nice.  Let's apply a little more ingenuity to the problem.  Idea:
have an existing command block on reading a FIFO special file, unblock
it by opening the FIFO for writing.

For 1., use

    {"execute": "blockdev-add",  "id": ID1,
     "arguments": {
        "driver": "blkdebug", "node-name": ID1, "config": FIFO,
        "image": { "driver": "null-co"}}}

where ID1 is an arbitrary string, and FIFO is the name of the FIFO.

For 2., use

    {"execute": "migrate-pause", "id": ID2, "control": {"run-oob": true}}

where ID2 is a different arbitrary string.  Since there's no migration
to pause, the command will fail, but that's fine; instant failure is
still a test of out-of-band responses overtaking in-band commands.

For 3., open FIFO for writing.

Drop QMP command x-oob-test.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20180703085358.13941-6-armbru@redhat.com>
[Error checking tweaked]
2018-07-03 23:15:43 +02:00
..
Makefile.objs qapi: rename *qmp-*-visitor* to *qobject-*-visitor* 2016-10-25 16:25:48 +02:00
block-core.json qapi: remove empty flat union branches and types 2018-06-22 16:33:46 +02:00
block.json pr-manager-helper: report event on connection/disconnection 2018-06-28 19:05:35 +02:00
char.json qmp: Enable a few commands in preconfig state 2018-06-21 12:49:12 +01:00
common.json qapi: Change "since 2.13" annotations to "since 3.0" 2018-05-29 11:28:46 +01:00
crypto.json qapi: remove empty flat union branches and types 2018-06-22 16:33:46 +02:00
introspect.json qapi: introduce new cmd option "allow-preconfig" 2018-05-30 13:19:09 -03:00
job.json qapi/job: The next release will be 3.0 2018-06-29 14:20:56 +02:00
migration.json migration: Create multifd_bytes ram_counter 2018-06-27 13:28:11 +02:00
misc.json qmp: Get rid of x-oob-test command 2018-07-03 23:15:43 +02:00
net.json qapi: remove empty flat union branches and types 2018-06-22 16:33:46 +02:00
opts-visitor.c qapi: Fix QemuOpts visitor regression on unvisited input 2017-03-22 19:24:34 +01:00
qapi-clone-visitor.c qapi/qnull: Add own header 2017-11-17 18:21:30 +01:00
qapi-dealloc-visitor.c qobject: Replace qobject_incref/QINCREF qobject_decref/QDECREF 2018-05-04 08:27:53 +02:00
qapi-schema.json job: Introduce qapi/job.json 2018-05-23 14:30:51 +02:00
qapi-util.c qapi: Change data type of the FOO_lookup generated for enum FOO 2017-09-04 13:09:13 +02:00
qapi-visit-core.c Include qapi/qmp/qobject.h exactly where needed 2018-02-09 13:52:15 +01:00
qmp-dispatch.c cli: add --preconfig option 2018-05-30 13:19:14 -03:00
qmp-event.c Include qapi/qmp/qdict.h exactly where needed 2018-02-09 13:52:15 +01:00
qmp-registry.c qapi: Support multiple command registries per program 2017-03-05 09:12:25 +01:00
qobject-input-visitor.c qobject: Modify qobject_ref() to return obj 2018-05-04 08:27:53 +02:00
qobject-output-visitor.c qobject: Modify qobject_ref() to return obj 2018-05-04 08:27:53 +02:00
rocker.json qapi: The #optional tag is redundant, drop 2017-03-16 07:13:02 +01:00
run-state.json qapi: introduce new cmd option "allow-preconfig" 2018-05-30 13:19:09 -03:00
sockets.json sockets: allow SocketAddress 'fd' to reference numeric file descriptors 2018-03-13 18:06:06 +00:00
string-input-visitor.c qapi/qnull: Add own header 2017-11-17 18:21:30 +01:00
string-output-visitor.c qapi: Use QNull for a more regular visit_type_null() 2017-07-24 13:35:11 +02:00
tpm.json tpm: add CRB device 2018-01-29 14:22:50 -05:00
trace-events trace: forbid floating point types 2018-06-27 11:09:29 +01:00
trace.json qapi-schema: Improve section headings 2017-09-04 13:09:12 +02:00
transaction.json qmp: transaction support for x-block-dirty-bitmap-enable/disable 2018-06-11 14:53:32 -04:00
ui.json qapi: remove empty flat union branches and types 2018-06-22 16:33:46 +02:00