[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 16/32] tests/qmp-test: Demonstrate QMP errors jum
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PATCH v2 16/32] tests/qmp-test: Demonstrate QMP errors jumping the queue |
Date: |
Tue, 3 Jul 2018 10:53:42 +0200 |
When OOB is enabled, out-of-band commands are executed right away,
everything else is queued. This lets out-of-band commands "jump the
queue".
However, certain errors are always reported right away, and therefore
can jump the queue even when the erroneous input does not request
out-of-band execution. These errors are pretty unlikely to occur in
production, but it's wrong all the same. Mark FIXME.
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Peter Xu <address@hidden>
---
monitor.c | 1 +
tests/qmp-test.c | 7 +++++++
2 files changed, 8 insertions(+)
diff --git a/monitor.c b/monitor.c
index 51ba1485ad..28fa9b8d44 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4338,6 +4338,7 @@ static void handle_qmp_command(JSONMessageParser *parser,
GQueue *tokens)
return;
err:
+ /* FIXME overtakes queued in-band commands, wrong when !qmp_is_oob() */
monitor_qmp_respond(mon, NULL, err, NULL);
qobject_unref(req);
}
diff --git a/tests/qmp-test.c b/tests/qmp-test.c
index 3f4e43bd2b..6581d1d755 100644
--- a/tests/qmp-test.c
+++ b/tests/qmp-test.c
@@ -242,6 +242,13 @@ static void test_qmp_oob(void)
unblock_blocked_cmd();
recv_cmd_id(qts, "ib-blocks-1");
recv_cmd_id(qts, "ib-quick-1");
+
+ /* FIXME certain in-band errors overtake slow in-band command */
+ send_cmd_that_blocks(qts, "blocks-2");
+ qtest_async_qmp(qts, "{ 'id': 'err-2' }");
+ recv_cmd_id(qts, NULL);
+ unblock_blocked_cmd();
+ recv_cmd_id(qts, "blocks-2");
cleanup_blocking_cmd();
qtest_quit(qts);
--
2.17.1
- [Qemu-devel] [PATCH v2 00/32] ] qmp: Fixes and cleanups around OOB commands, Markus Armbruster, 2018/07/03
- [Qemu-devel] [PATCH v2 08/32] tests/test-qga: Demonstrate the guest-agent ignores "id", Markus Armbruster, 2018/07/03
- [Qemu-devel] [PATCH v2 10/32] tests/test-qga: Demonstrate the guest-agent ignores "control", Markus Armbruster, 2018/07/03
- [Qemu-devel] [PATCH v2 13/32] qmp: Revert change to handle_qmp_command tracepoint, Markus Armbruster, 2018/07/03
- [Qemu-devel] [PATCH v2 16/32] tests/qmp-test: Demonstrate QMP errors jumping the queue,
Markus Armbruster <=
- [Qemu-devel] [PATCH v2 06/32] tests/qmp-test: Test in-band command doesn't overtake, Markus Armbruster, 2018/07/03
- [Qemu-devel] [PATCH v2 03/32] docs/interop/qmp: Improve OOB documentation, Markus Armbruster, 2018/07/03
- [Qemu-devel] [PATCH v2 28/32] qmp: Switch timestamp_put() to qdict_from_jsonf_nofail(), Markus Armbruster, 2018/07/03
- [Qemu-devel] [PATCH v2 15/32] qmp: Simplify code around monitor_qmp_dispatch_one(), Markus Armbruster, 2018/07/03
- [Qemu-devel] [PATCH v2 01/32] qmp: Say "out-of-band" instead of "Out-Of-Band", Markus Armbruster, 2018/07/03
- [Qemu-devel] [PATCH v2 02/32] monitor: Spell "I/O thread" consistently in comments, Markus Armbruster, 2018/07/03
- [Qemu-devel] [PATCH v2 29/32] qobject: Let qobject_from_jsonf() fail instead of abort, Markus Armbruster, 2018/07/03
- [Qemu-devel] [PATCH v2 26/32] qmp: Simplify monitor_qmp_respond(), Markus Armbruster, 2018/07/03