Commit d621cfe0 authored by Markus Armbruster's avatar Markus Armbruster
Browse files

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: default avatarMarkus Armbruster <armbru@redhat.com>
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
Message-Id: <20180703085358.13941-5-armbru@redhat.com>
parent 71696cc6
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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);
+3 −0
Original line number Diff line number Diff line
@@ -3454,6 +3454,9 @@
# only be dropped when the oob capability is enabled.
#
# @id: The dropped command's "id" field.
# FIXME Broken by design.  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.
#
# @reason: The reason why the command is dropped.
#