From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: peterx@redhat.com, eblake@redhat.com, stefanha@redhat.com,
dgilbert@redhat.com, mdroth@linux.vnet.ibm.com
Subject: [Qemu-devel] [PATCH v2 04/32] qmp: Document COMMAND_DROPPED design flaw
Date: Tue, 3 Jul 2018 10:53:30 +0200 [thread overview]
Message-ID: <20180703085358.13941-5-armbru@redhat.com> (raw)
In-Reply-To: <20180703085358.13941-1-armbru@redhat.com>
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>
---
monitor.c | 6 ++++++
qapi/misc.json | 3 +++
2 files changed, 9 insertions(+)
diff --git a/monitor.c b/monitor.c
index 3fb05d50aa..96e87d8664 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4330,6 +4330,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
next prev parent reply other threads:[~2018-07-03 8:54 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-03 8:53 [Qemu-devel] [PATCH v2 00/32] ] qmp: Fixes and cleanups around OOB commands Markus Armbruster
2018-07-03 8:53 ` [Qemu-devel] [PATCH v2 01/32] qmp: Say "out-of-band" instead of "Out-Of-Band" Markus Armbruster
2018-07-03 8:53 ` [Qemu-devel] [PATCH v2 02/32] monitor: Spell "I/O thread" consistently in comments Markus Armbruster
2018-07-03 8:53 ` [Qemu-devel] [PATCH v2 03/32] docs/interop/qmp: Improve OOB documentation Markus Armbruster
2018-07-03 15:31 ` Eric Blake
2018-07-03 15:41 ` Markus Armbruster
2018-07-03 8:53 ` Markus Armbruster [this message]
2018-07-03 8:53 ` [Qemu-devel] [PATCH v2 05/32] qmp: Get rid of x-oob-test command Markus Armbruster
2018-07-03 15:37 ` Eric Blake
2018-07-03 8:53 ` [Qemu-devel] [PATCH v2 06/32] tests/qmp-test: Test in-band command doesn't overtake Markus Armbruster
2018-07-03 8:53 ` [Qemu-devel] [PATCH v2 07/32] qmp: Make "id" optional again even in "oob" monitors Markus Armbruster
2018-07-03 15:39 ` Eric Blake
2018-07-03 8:53 ` [Qemu-devel] [PATCH v2 08/32] tests/test-qga: Demonstrate the guest-agent ignores "id" Markus Armbruster
2018-07-03 8:53 ` [Qemu-devel] [PATCH v2 09/32] qmp qemu-ga: Revert change that accidentally made qemu-ga accept "id" Markus Armbruster
2018-07-03 8:53 ` [Qemu-devel] [PATCH v2 10/32] tests/test-qga: Demonstrate the guest-agent ignores "control" Markus Armbruster
2018-07-03 8:53 ` [Qemu-devel] [PATCH v2 11/32] qmp qemu-ga: Fix qemu-ga not to accept "control" Markus Armbruster
2018-07-03 8:53 ` [Qemu-devel] [PATCH v2 12/32] qmp: Redo how the client requests out-of-band execution Markus Armbruster
2018-07-03 15:42 ` Eric Blake
2018-07-03 8:53 ` [Qemu-devel] [PATCH v2 13/32] qmp: Revert change to handle_qmp_command tracepoint Markus Armbruster
2018-07-03 8:53 ` [Qemu-devel] [PATCH v2 14/32] qmp: Always free QMPRequest with qmp_request_free() Markus Armbruster
2018-07-03 8:53 ` [Qemu-devel] [PATCH v2 15/32] qmp: Simplify code around monitor_qmp_dispatch_one() Markus Armbruster
2018-07-03 8:53 ` [Qemu-devel] [PATCH v2 16/32] tests/qmp-test: Demonstrate QMP errors jumping the queue Markus Armbruster
2018-07-03 8:53 ` [Qemu-devel] [PATCH v2 17/32] qmp: Don't let malformed in-band commands jump " Markus Armbruster
2018-07-03 8:53 ` [Qemu-devel] [PATCH v2 18/32] qmp: Don't let JSON errors " Markus Armbruster
2018-07-03 8:53 ` [Qemu-devel] [PATCH v2 19/32] monitor: Rename use_io_thr to use_io_thread Markus Armbruster
2018-07-03 8:53 ` [Qemu-devel] [PATCH v2 20/32] monitor: Peel off @mon_global wrapper Markus Armbruster
2018-07-03 8:53 ` [Qemu-devel] [PATCH v2 21/32] qobject: New qdict_from_jsonf_nofail() Markus Armbruster
2018-07-03 8:53 ` [Qemu-devel] [PATCH v2 22/32] qmp: De-duplicate error response building Markus Armbruster
2018-07-03 8:53 ` [Qemu-devel] [PATCH v2 23/32] qmp: Use QDict * instead of QObject * for response objects Markus Armbruster
2018-07-03 8:53 ` [Qemu-devel] [PATCH v2 24/32] qmp: Replace monitor_json_emitter{, raw}() by qmp_{queue, send}_response() Markus Armbruster
2018-07-03 8:53 ` [Qemu-devel] [PATCH v2 25/32] qmp: Replace get_qmp_greeting() by qmp_greeting() Markus Armbruster
2018-07-03 8:53 ` [Qemu-devel] [PATCH v2 26/32] qmp: Simplify monitor_qmp_respond() Markus Armbruster
2018-07-03 8:53 ` [Qemu-devel] [PATCH v2 27/32] qmp: Add some comments around null responses Markus Armbruster
2018-07-03 8:53 ` [Qemu-devel] [PATCH v2 28/32] qmp: Switch timestamp_put() to qdict_from_jsonf_nofail() Markus Armbruster
2018-07-03 8:53 ` [Qemu-devel] [PATCH v2 29/32] qobject: Let qobject_from_jsonf() fail instead of abort Markus Armbruster
2018-07-03 8:53 ` [Qemu-devel] [PATCH v2 30/32] qmp: Clean up capability negotiation after commit 02130314d8c Markus Armbruster
2018-07-03 8:53 ` [Qemu-devel] [PATCH v2 31/32] monitor: Improve some comments Markus Armbruster
2018-07-03 8:53 ` [Qemu-devel] [PATCH v2 32/32] qapi: Polish command flags documentation in qapi-code-gen.txt Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180703085358.13941-5-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=dgilbert@redhat.com \
--cc=eblake@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).