All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Daniel P . Berrange" <berrange@redhat.com>,
	peterx@redhat.com, "Eric Blake" <eblake@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Dr . David Alan Gilbert" <dgilbert@redhat.com>
Subject: [Qemu-devel] [PATCH 0/9] monitor: enable OOB by default
Date: Wed,  4 Jul 2018 16:44:58 +0800	[thread overview]
Message-ID: <20180704084507.14560-1-peterx@redhat.com> (raw)

Based-on: <20180703085358.13941-1-armbru@redhat.com>

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(-)

-- 
2.17.1

             reply	other threads:[~2018-07-04  8:45 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-04  8:44 Peter Xu [this message]
2018-07-04  8:44 ` [Qemu-devel] [PATCH 1/9] monitor: simplify monitor_qmp_setup_handlers_bh Peter Xu
2018-07-05  5:44   ` Markus Armbruster
2018-07-04  8:45 ` [Qemu-devel] [PATCH 2/9] qapi: allow build_params to return "void" Peter Xu
2018-07-05  6:02   ` Markus Armbruster
2018-07-05  6:18     ` Peter Xu
2018-07-04  8:45 ` [Qemu-devel] [PATCH 3/9] qapi: remove error checks for event emission Peter Xu
2018-07-05  8:43   ` Markus Armbruster
2018-07-05  9:17     ` Peter Xu
2018-07-04  8:45 ` [Qemu-devel] [PATCH 4/9] monitor: move need_resume flag into monitor struct Peter Xu
2018-07-05  8:51   ` Markus Armbruster
2018-07-05  9:49     ` Peter Xu
2018-07-05 11:09       ` Markus Armbruster
2018-07-05 11:32         ` Marc-André Lureau
2018-07-05 12:01           ` Peter Xu
2018-07-04  8:45 ` [Qemu-devel] [PATCH 5/9] monitor: suspend monitor instead of send CMD_DROP Peter Xu
2018-07-05 16:47   ` Eric Blake
2018-07-06  3:49     ` Peter Xu
2018-07-06  8:00       ` Markus Armbruster
2018-07-06  8:09   ` Markus Armbruster
2018-07-06  9:39     ` Peter Xu
2018-07-06 13:19       ` Markus Armbruster
2018-07-10  4:27         ` Peter Xu
2018-07-12  6:10           ` Markus Armbruster
2018-07-12 13:23             ` Markus Armbruster
2018-07-04  8:45 ` [Qemu-devel] [PATCH 6/9] qapi: remove COMMAND_DROPPED event Peter Xu
2018-07-04  8:45 ` [Qemu-devel] [PATCH 7/9] monitor: restrict response queue length too Peter Xu
2018-07-04  8:45 ` [Qemu-devel] [PATCH 8/9] monitor: remove "x-oob", turn oob on by default Peter Xu
2018-07-04  8:45 ` [Qemu-devel] [PATCH 9/9] Revert "tests: Add parameter to qtest_init_without_qmp_handshake" Peter Xu
2018-07-16 17:18 ` [Qemu-devel] [PATCH 0/9] monitor: enable OOB by default Markus Armbruster
2018-07-17 12:08   ` Peter Xu
2018-07-18  8:47     ` Peter Xu
2018-07-18 13:09       ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180704084507.14560-1-peterx@redhat.com \
    --to=peterx@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.