[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v8 22/23] tests: qmp-test: verify command batchi
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v8 22/23] tests: qmp-test: verify command batching |
Date: |
Sat, 10 Mar 2018 20:45:46 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
On 03/09/2018 03:00 AM, Peter Xu wrote:
OOB introduced DROP event for flow control. This should not affect old
QMP clients. Add a command batching check to make sure of it.
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
---
tests/qmp-test.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
+ /*
+ * Test command batching. In current test OOB is not enabled, we
+ * should be able to run as many commands in batch as we like.
+ * Using 16 (>8, which is OOB queue length) to make sure OOB won't
+ * break existing clients. Note: this test does not control the
+ * scheduling of QEMU's QMP command processing threads so it may
+ * not really trigger batching inside QEMU. This is just a
+ * best-effort test.
+ */
+ for (i = 0; i < 16; i++) {
+ qtest_async_qmp(qts, "{ 'execute': 'query-version' }");
Would the test be any more robust if we could generate a single string
to send all at once, rather than multiple separate calls to
qtest_async_qmp() (the overhead in generating separate strings means the
monitor may have made progress before we send the next string). But
that can be a followup, if you want to pursue the idea.
+ }
+ /* Verify the replies to make sure no command is dropped. */
+ for (i = 0; i < 16; i++) {
+ resp = qtest_qmp_receive(qts);
+ /* It should never be dropped. Each of them should be a reply. */
+ g_assert(qdict_haskey(resp, "return"));
+ g_assert(!qdict_haskey(resp, "event"));
+ QDECREF(resp);
Should we also be sending unique ids, and ensure that the responses
arrive with ids in the same order? Again, idea for a followup.
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
- [Qemu-devel] [PATCH v8 17/23] qapi: introduce new cmd option "allow-oob", (continued)
- [Qemu-devel] [PATCH v8 17/23] qapi: introduce new cmd option "allow-oob", Peter Xu, 2018/03/09
- [Qemu-devel] [PATCH v8 18/23] qmp: support out-of-band (oob) execution, Peter Xu, 2018/03/09
- [Qemu-devel] [PATCH v8 19/23] qmp: isolate responses into io thread, Peter Xu, 2018/03/09
- [Qemu-devel] [PATCH v8 20/23] monitor: enable IO thread for (qmp & !mux) typed, Peter Xu, 2018/03/09
- [Qemu-devel] [PATCH v8 21/23] qmp: add command "x-oob-test", Peter Xu, 2018/03/09
- [Qemu-devel] [PATCH v8 22/23] tests: qmp-test: verify command batching, Peter Xu, 2018/03/09
- Re: [Qemu-devel] [PATCH v8 22/23] tests: qmp-test: verify command batching,
Eric Blake <=
- [Qemu-devel] [PATCH v8 23/23] tests: qmp-test: add oob test, Peter Xu, 2018/03/09
- Re: [Qemu-devel] [PATCH v8 00/23] QMP: out-of-band (OOB) execution support, Eric Blake, 2018/03/10
- Re: [Qemu-devel] [PATCH v8 00/23] QMP: out-of-band (OOB) execution support, Eric Blake, 2018/03/12