aboutsummaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2018-07-03 10:53:30 +0200
committerMarkus Armbruster <armbru@redhat.com>2018-07-03 23:09:49 +0200
commitd621cfe0a177978b17711a712293221294430f53 (patch)
tree214068b47bd8d4abf2f16a073aa2a085cdcada7b /monitor.c
parent71696cc66ce74a645e68844340e9fb5cfd598cc2 (diff)
downloadqemu-d621cfe0a177978b17711a712293221294430f53.zip
qemu-d621cfe0a177978b17711a712293221294430f53.tar.gz
qemu-d621cfe0a177978b17711a712293221294430f53.tar.bz2
qmp: Document COMMAND_DROPPED design flaw
Events are broadcast to all monitors. If another monitor's client has a command with the same ID in flight, the event will incorrectly claim that command was dropped. This must be fixed before out-of-band execution can graduate from "experimental". Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20180703085358.13941-5-armbru@redhat.com>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/monitor.c b/monitor.c
index 4f4f309..3ad89fe 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4331,6 +4331,12 @@ static void handle_qmp_command(JSONMessageParser *parser, GQueue *tokens)
/* Drop the request if queue is full. */
if (mon->qmp.qmp_requests->length >= QMP_REQ_QUEUE_LEN_MAX) {
qemu_mutex_unlock(&mon->qmp.qmp_queue_lock);
+ /*
+ * FIXME @id's scope is just @mon, and broadcasting it is
+ * wrong. If another monitor's client has a command with
+ * the same ID in flight, the event will incorrectly claim
+ * that command was dropped.
+ */
qapi_event_send_command_dropped(id,
COMMAND_DROP_REASON_QUEUE_FULL,
&error_abort);