From: Markus Armbruster <armbru@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH v2] chardev: add nodelay option
Date: Wed, 03 Mar 2021 14:24:13 +0100 [thread overview]
Message-ID: <87mtvkjrpe.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20210303123235.63171-1-pbonzini@redhat.com> (Paolo Bonzini's message of "Wed, 3 Mar 2021 13:32:35 +0100")
Paolo Bonzini <pbonzini@redhat.com> writes:
> The "delay" option was introduced as a way to enable Nagle's algorithm
> with ",nodelay". Since the short form for boolean options has now been
> deprecated, introduce a more properly named "nodelay" option. The "delay"
> option remains as an undocumented option.
>
> "delay" and "nodelay" are mutually exclusive. Because the check is
> done at consumption time, the code also rejects them if one of the
> two is specified via -set.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> chardev/char-socket.c | 13 +++++++++++--
> gdbstub.c | 2 +-
> qemu-options.hx | 14 +++++++-------
> 3 files changed, 19 insertions(+), 10 deletions(-)
I believe this is
Based-on: <20210226080526.651705-1-pbonzini@redhat.com>
>
> diff --git a/chardev/char-socket.c b/chardev/char-socket.c
> index 06a37c0cc8..c8bced76b7 100644
> --- a/chardev/char-socket.c
> +++ b/chardev/char-socket.c
> @@ -1472,8 +1472,17 @@ static void qemu_chr_parse_socket(QemuOpts *opts, ChardevBackend *backend,
> sock = backend->u.socket.data = g_new0(ChardevSocket, 1);
> qemu_chr_parse_common(opts, qapi_ChardevSocket_base(sock));
>
> - sock->has_nodelay = qemu_opt_get(opts, "delay");
> - sock->nodelay = !qemu_opt_get_bool(opts, "delay", true);
> + if (qemu_opt_get(opts, "delay") && qemu_opt_get(opts, "nodelay")) {
> + error_setg(errp, "'delay' and 'nodelay' are mutually exclusive");
> + return;
> + }
> + sock->has_nodelay =
> + qemu_opt_get(opts, "delay") ||
> + qemu_opt_get(opts, "nodelay");
> + sock->nodelay =
> + !qemu_opt_get_bool(opts, "delay", true) ||
> + qemu_opt_get_bool(opts, "nodelay", false);
> +
> /*
> * We have different default to QMP for 'server', hence
> * we can't just check for existence of 'server'
$ qemu-system-x86_64 -chardev socket,id=chr0,path=sock,nodelay=on
qemu-system-x86_64: -chardev socket,id=chr0,path=sock,nodelay=on: Invalid parameter 'nodelay'
You forgot to update qemu_chardev_opts:
diff --git a/chardev/char.c b/chardev/char.c
index 288efebd12..e6128c046f 100644
--- a/chardev/char.c
+++ b/chardev/char.c
@@ -864,6 +864,9 @@ QemuOptsList qemu_chardev_opts = {
},{
.name = "server",
.type = QEMU_OPT_BOOL,
+ },{
+ .name = "nodelay",
+ .type = QEMU_OPT_BOOL,
},{
.name = "delay",
.type = QEMU_OPT_BOOL,
[...]
next prev parent reply other threads:[~2021-03-03 13:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-03 12:32 [PATCH v2] chardev: add nodelay option Paolo Bonzini
2021-03-03 13:24 ` Markus Armbruster [this message]
2021-03-03 13:31 ` Paolo Bonzini
2021-03-03 13:51 ` 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=87mtvkjrpe.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=pbonzini@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.