[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 07/32] qmp: Make "id" optional again even in "oob
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PATCH v2 07/32] qmp: Make "id" optional again even in "oob" monitors |
Date: |
Tue, 3 Jul 2018 10:53:33 +0200 |
Commit cf869d53172 "qmp: support out-of-band (oob) execution" made
"id" mandatory for all commands when the client accepted capability
"oob". This is rather onerous when you play with QMP by hand, and
unnecessarily so: only out-of-band commands need an ID for reliable
matching of response to command.
Revert that part of commit cf869d53172 for now, but have documentation
advise on the need to use "id" with out-of-band commands.
Signed-off-by: Markus Armbruster <address@hidden>
---
docs/interop/qmp-spec.txt | 13 +++++++------
monitor.c | 7 -------
2 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/docs/interop/qmp-spec.txt b/docs/interop/qmp-spec.txt
index 6b72b69cb1..a1d6f9ee06 100644
--- a/docs/interop/qmp-spec.txt
+++ b/docs/interop/qmp-spec.txt
@@ -103,16 +103,13 @@ The format for command execution is:
required. Each command documents what contents will be considered
valid when handling the json-argument
- The "id" member is a transaction identification associated with the
- command execution. It is required for all commands if the OOB -
- capability was enabled at startup, and optional otherwise. The same
- "id" field will be part of the response if provided. The "id"
- member can be any json-value. A json-number incremented for each
- successive command works fine.
+ command execution, it is optional and will be part of the response
+ if provided. The "id" member can be any json-value. A json-number
+ incremented for each successive command works fine.
- The optional "control" member further specifies how the command is
to be executed. Currently, its only member is optional "run-oob".
See section "2.3.1 Out-of-band execution" for details.
-
2.3.1 Out-of-band execution
---------------------------
@@ -128,6 +125,10 @@ possibly overtaking prior in-band commands. The client
may therefore
receive such a command's response before responses from prior in-band
commands.
+To be able to match responses back to their commands, the client needs
+to pass "id" with out-of-band commands. Passing it with all commands
+is recommended for clients that accept capability "oob".
+
To execute a command out-of-band, the client puts "run-oob": true into
execute's member "control".
diff --git a/monitor.c b/monitor.c
index 96e87d8664..b7d74b01b4 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4291,13 +4291,6 @@ static void handle_qmp_command(JSONMessageParser
*parser, GQueue *tokens)
id = qdict_get(qdict, "id");
- /* When OOB is enabled, the "id" field is mandatory. */
- if (qmp_oob_enabled(mon) && !id) {
- error_setg(&err, "Out-of-band capability requires that "
- "every command contains an 'id' field");
- goto err;
- }
-
req_obj = g_new0(QMPRequest, 1);
req_obj->mon = mon;
req_obj->id = qobject_ref(id);
--
2.17.1
- [Qemu-devel] [PATCH v2 05/32] qmp: Get rid of x-oob-test command, (continued)
- [Qemu-devel] [PATCH v2 05/32] qmp: Get rid of x-oob-test command, Markus Armbruster, 2018/07/03
- [Qemu-devel] [PATCH v2 18/32] qmp: Don't let JSON errors jump the queue, Markus Armbruster, 2018/07/03
- [Qemu-devel] [PATCH v2 22/32] qmp: De-duplicate error response building, Markus Armbruster, 2018/07/03
- [Qemu-devel] [PATCH v2 09/32] qmp qemu-ga: Revert change that accidentally made qemu-ga accept "id", Markus Armbruster, 2018/07/03
- [Qemu-devel] [PATCH v2 25/32] qmp: Replace get_qmp_greeting() by qmp_greeting(), Markus Armbruster, 2018/07/03
- [Qemu-devel] [PATCH v2 11/32] qmp qemu-ga: Fix qemu-ga not to accept "control", Markus Armbruster, 2018/07/03
- [Qemu-devel] [PATCH v2 17/32] qmp: Don't let malformed in-band commands jump the queue, Markus Armbruster, 2018/07/03
- [Qemu-devel] [PATCH v2 27/32] qmp: Add some comments around null responses, Markus Armbruster, 2018/07/03
- [Qemu-devel] [PATCH v2 24/32] qmp: Replace monitor_json_emitter{, raw}() by qmp_{queue, send}_response(), Markus Armbruster, 2018/07/03
- [Qemu-devel] [PATCH v2 07/32] qmp: Make "id" optional again even in "oob" monitors,
Markus Armbruster <=
- [Qemu-devel] [PATCH v2 12/32] qmp: Redo how the client requests out-of-band execution, Markus Armbruster, 2018/07/03
- [Qemu-devel] [PATCH v2 31/32] monitor: Improve some comments, Markus Armbruster, 2018/07/03
- [Qemu-devel] [PATCH v2 20/32] monitor: Peel off @mon_global wrapper, Markus Armbruster, 2018/07/03
- [Qemu-devel] [PATCH v2 23/32] qmp: Use QDict * instead of QObject * for response objects, Markus Armbruster, 2018/07/03
- [Qemu-devel] [PATCH v2 32/32] qapi: Polish command flags documentation in qapi-code-gen.txt, Markus Armbruster, 2018/07/03
- [Qemu-devel] [PATCH v2 19/32] monitor: Rename use_io_thr to use_io_thread, Markus Armbruster, 2018/07/03
- [Qemu-devel] [PATCH v2 30/32] qmp: Clean up capability negotiation after commit 02130314d8c, Markus Armbruster, 2018/07/03
- [Qemu-devel] [PATCH v2 14/32] qmp: Always free QMPRequest with qmp_request_free(), Markus Armbruster, 2018/07/03