monitor: send event when command queue full
commitbf1e7301745af6d0f4acd74da4ccfce27ad6eadf
authorPeter Xu <peterx@redhat.com>
Fri, 9 Mar 2018 08:59:59 +0000 (9 16:59 +0800)
committerEric Blake <eblake@redhat.com>
Mon, 19 Mar 2018 19:58:37 +0000 (19 14:58 -0500)
treeb06e1670c0def7755a55c03673cecf5637683940
parent8167d8bd363f9ee22c9ee53566a51cfe886d39f1
monitor: send event when command queue full

Set maximum QMP command queue length to 8.  If the queue is full,
instead of queuing the command, we directly return a "command-dropped"
event, telling the client that a specific command is dropped.

Note that this flow control mechanism is only valid if OOB is enabled.
If it's not, the effective queue length will always be 1, which strictly
follows original behavior of QMP command handling (which never drops
messages).

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20180309090006.10018-17-peterx@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: commit message grammar, abort on failure to send event]
Signed-off-by: Eric Blake <eblake@redhat.com>
monitor.c