qemu-e2k/docs/interop
Peter Xu 9ab84470ff monitor: Suspend monitor instead dropping commands
When a QMP client sends in-band commands more quickly that we can
process them, we can either queue them without limit (QUEUE), drop
commands when the queue is full (DROP), or suspend receiving commands
when the queue is full (SUSPEND).  None of them is ideal:

* QUEUE lets a misbehaving client make QEMU eat memory without bounds.
Not such a hot idea.

* With DROP, the client has to cope with dropped in-band commands.  To
inform the client, we send a COMMAND_DROPPED event then.  The event is
flawed by design in two ways: it's ambiguous (see commit d621cfe0a1),
and it brings back the "eat memory without bounds" problem.

* With SUSPEND, the client has to manage the flow of in-band commands to
keep the monitor available for out-of-band commands.

We currently DROP.  Switch to SUSPEND.

Managing the flow of in-band commands to keep the monitor available for
out-of-band commands isn't really hard: just count the number of
"outstanding" in-band commands (commands sent minus replies received),
and if it exceeds the limit, hold back additional ones until it drops
below the limit again.

Note that we need to be careful pairing the suspend with a resume, or
else the monitor will hang, possibly forever.  And here since we need to
make sure both:

     (1) popping request from the req queue, and
     (2) reading length of the req queue

will be in the same critical section, we let the pop function take the
corresponding queue lock when there is a request, then we release the
lock from the caller.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20181009062718.1914-2-peterx@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2018-12-12 09:55:57 +01:00
..
bitmaps.rst bitmaps.md: Convert to rST; move it into 'interop' dir 2017-07-18 00:11:01 -04:00
firmware.json docs/interop: add "firmware.json" 2018-06-01 15:14:25 +02:00
live-block-operations.rst Remove the deprecated -nodefconfig option 2018-08-31 09:52:46 +02:00
nbd.txt docs/interop: add nbd.txt 2018-06-21 09:23:59 -05:00
parallels.txt
pr-helper.rst scsi: build qemu-pr-helper 2017-09-22 21:07:24 +02:00
prl-xml.txt docs/interop/prl-xml: description of Parallels Disk format 2018-01-22 14:02:33 +00:00
qcow2.txt qcow2: Document some maximum size constraints 2018-11-19 12:51:40 +01:00
qed_spec.txt
qemu-ga-ref.texi
qemu-qmp-ref.texi
qmp-intro.txt docs/interop/qmp: Improve OOB documentation 2018-07-03 23:09:31 +02:00
qmp-spec.txt monitor: Suspend monitor instead dropping commands 2018-12-12 09:55:57 +01:00
vhost-user.txt docs: Fix some typos (most found by codespell) 2018-09-25 17:26:18 +02:00
vnc-ledstate-Pseudo-encoding.txt