Skip to content

monitor: enable OOB by default

Peter Xu qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 23 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9monitor: simplify monitor_qmp_setup_handlers_bhmonitor.c+4 -91 reply
2/9qapi: allow build_params to return "void"scripts/qapi/common.py+2 -22 replies
3/9qapi: remove error checks for event emissionblock/block-backend.c block/qcow2.c block/quorum.c +26 more+69 -1032 replies
4/9monitor: move need_resume flag into monitor structmonitor.c+41 -315 replies
5/9monitor: suspend monitor instead of send CMD_DROPmonitor.c+30 -169 replies
6/9qapi: remove COMMAND_DROPPED eventqapi/misc.json+0 -400 replies
7/9monitor: restrict response queue length toomonitor.c+19 -120 replies
8/9monitor: remove "x-oob", turn oob on by defaultinclude/monitor/monitor.h monitor.c tests/libqtest.c +2 more+8 -240 replies
9/9Revert "tests: Add parameter to qtest_init_without_qmp_handshake"tests/libqtest.c tests/libqtest.h tests/qmp-test.c+7 -110 replies

Reviews trailers per patch

3 of 9 patches have a Reviewed-by or Acked-by.

PatchMarkus Armbruster
1/9R-b
2/9
3/9
4/9
5/9
6/9
7/9
8/9R-b
9/9R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

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