[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 04/32] qmp: Document COMMAND_DROPPED design flaw
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PULL v2 04/32] qmp: Document COMMAND_DROPPED design flaw |
Date: |
Tue, 3 Jul 2018 23:35:28 +0200 |
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 <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
---
monitor.c | 6 ++++++
qapi/misc.json | 3 +++
2 files changed, 9 insertions(+)
diff --git a/monitor.c b/monitor.c
index 4f4f309d45..3ad89fe1ba 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);
diff --git a/qapi/misc.json b/qapi/misc.json
index 0446c3e48e..74cd97f237 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
@@ -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.
#
--
2.17.1
- [Qemu-devel] [PULL v2 00/32] Monitor patches for 2018-07-03, Markus Armbruster, 2018/07/03
- [Qemu-devel] [PULL v2 04/32] qmp: Document COMMAND_DROPPED design flaw,
Markus Armbruster <=
- [Qemu-devel] [PULL v2 14/32] qmp: Always free QMPRequest with qmp_request_free(), Markus Armbruster, 2018/07/03
- [Qemu-devel] [PULL v2 02/32] monitor: Spell "I/O thread" consistently in comments, Markus Armbruster, 2018/07/03
- [Qemu-devel] [PULL v2 10/32] tests/test-qga: Demonstrate the guest-agent ignores "control", Markus Armbruster, 2018/07/03
- [Qemu-devel] [PULL v2 03/32] docs/interop/qmp: Improve OOB documentation, Markus Armbruster, 2018/07/03
- [Qemu-devel] [PULL v2 13/32] qmp: Revert change to handle_qmp_command tracepoint, Markus Armbruster, 2018/07/03
- [Qemu-devel] [PULL v2 32/32] qapi: Polish command flags documentation in qapi-code-gen.txt, Markus Armbruster, 2018/07/03
- [Qemu-devel] [PULL v2 16/32] tests/qmp-test: Demonstrate QMP errors jumping the queue, Markus Armbruster, 2018/07/03