monitor: enable OOB by default
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest9 patches 23 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/9 | monitor: simplify monitor_qmp_setup_handlers_bhmonitor.c | +4 | 1 reply | |
| 2/9 | qapi: allow build_params to return "void"scripts/ | +2 | 2 replies | |
| 3/9 | qapi: remove error checks for event emissionblock/ block/ block/ +26 more | +69 | 2 replies | |
| 4/9 | monitor: move need_resume flag into monitor structmonitor.c | +41 | 5 replies | |
| 5/9 | monitor: suspend monitor instead of send CMD_DROPmonitor.c | +30 | 9 replies | |
| 6/9 | qapi: remove COMMAND_DROPPED eventqapi/ | +0 | 0 replies | |
| 7/9 | monitor: restrict response queue length toomonitor.c | +19 | 0 replies | |
| 8/9 | monitor: remove "x-oob", turn oob on by defaultinclude/ monitor.c tests/ +2 more | +8 | 0 replies | |
| 9/9 | Revert "tests: Add parameter to qtest_init_without_qmp_handshake"tests/ tests/ tests/ | +7 | 0 replies |
Reviews trailers per patch
3 of 9 patches have a Reviewed-by or Acked-by.
| Patch | Markus Armbruster |
|---|---|
| 1/9 | R-b |
| 2/9 | |
| 3/9 | |
| 4/9 | |
| 5/9 | |
| 6/9 | |
| 7/9 | |
| 8/9 | R-b |
| 9/9 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [Qemu-devel] [PATCH 0/9] monitor: enable OOB by default
Based-on: <[email protected]>
This work is based on Markus's latest out-of-band fixes:
"[PATCH v2 00/32] ] qmp: Fixes and cleanups around OOB commands"
Major stuff: some cleanups that were previously suggested by Markus or Eric. Meanwhile fix up the flow control issue. Since my proposal here is to drop COMMAND_DROPPED event, then we don't need to introduce per-monitor event emission API any more. Though Markus told me that he might use that code somewhere else, so I'll post that per-monitor event code out separately as RFC later.
Patch 1-3: cleanups.
Patch 4-7: solve the flow control issue reported by Markus that response queue might overflow even if we have limitation on the request queue. Firstly we drop the COMMAND_DROP event since that won't work for response queue (since queuing an event will need to append to the response queue itself), then we use monitor suspend and resume to control the flow. Last, we apply that to response queue too.
Patch 8-9: the original patches to enable out-of-band by default.
Tests: I didn't write flow control tests for qtest, however I tested the program with this tiny tool "slowread":
#include <unistd.h>
#include <assert.h>
int main(void)
{
char c;
ssize_t ret;
while (1) {
ret = read(STDIN_FILENO, &c, 1);
if (ret != 1)
break;
write(STDOUT_FILENO, &c, 1);
usleep(1000);
}
return 0;
}Basically it limits the read speed to 1000Bps. Then I prepare a command list "cmd_list":
{"execute": "qmp_capabilities", "arguments": {"enable": ["oob"]}}
{"execute": "query-status"}
{"execute": "query-status"}
.....
{"execute": "query-status"}
{"execute": "query-status"}Then I run this to make sure it works well:
$ cat cmd_list | qemu-system-x86_64 -qmp stdio -nographic -nodefaults | slowread
Please review. Thanks,
Peter Xu (9):
monitor: simplify monitor_qmp_setup_handlers_bh
qapi: allow build_params to return "void"
qapi: remove error checks for event emission
monitor: move need_resume flag into monitor struct
monitor: suspend monitor instead of send CMD_DROP
qapi: remove COMMAND_DROPPED event
monitor: restrict response queue length too
monitor: remove "x-oob", turn oob on by default
Revert "tests: Add parameter to qtest_init_without_qmp_handshake"
docs/devel/qapi-code-gen.txt | 6 +- qapi/misc.json | 40 --------- include/monitor/monitor.h | 1 - include/qapi/qmp-event.h | 3 +- tests/libqtest.h | 4 +- block/block-backend.c | 8 +- block/qcow2.c | 2 +- block/quorum.c | 4 +- block/write-threshold.c | 3 +- blockjob.c | 13 ++- cpus.c | 8 +- dump.c | 3 +- hw/acpi/core.c | 2 +- hw/acpi/cpu.c | 2 +- hw/acpi/memory_hotplug.c | 5 +- hw/char/virtio-console.c | 3 +- hw/core/qdev.c | 3 +- hw/net/virtio-net.c | 2 +- hw/ppc/spapr_rtc.c | 2 +- hw/timer/mc146818rtc.c | 2 +- hw/virtio/virtio-balloon.c | 3 +- hw/watchdog/watchdog.c | 15 ++-- job.c | 2 +- migration/migration.c | 4 +- migration/ram.c | 2 +- monitor.c | 159 +++++++++++++++++++---------------- scsi/pr-manager-helper.c | 3 +- tests/libqtest.c | 10 +-- tests/qmp-test.c | 6 +- tests/test-qmp-event.c | 11 ++- ui/spice-core.c | 10 +-- ui/vnc.c | 7 +- vl.c | 21 ++--- scripts/qapi/common.py | 4 +- scripts/qapi/events.py | 23 ++--- 35 files changed, 164 insertions(+), 232 deletions(-)
Signature · 1 line
2.17.1