From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Juraj Marcin <jmarcin@redhat.com>
Cc: qemu-devel@nongnu.org, vsementsov@yandex-team.ru,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH v4 6/7] util/qemu-sockets: Refactor inet_parse() to use QemuOpts
Date: Mon, 19 May 2025 11:43:36 +0100 [thread overview]
Message-ID: <aCsLWCXlUQyh53LD@redhat.com> (raw)
In-Reply-To: <20250516155710.2246148-7-jmarcin@redhat.com>
On Fri, May 16, 2025 at 05:56:58PM +0200, Juraj Marcin wrote:
> From: Juraj Marcin <jmarcin@redhat.com>
>
> Currently, the inet address parser cannot handle multiple options where
> one is prefixed with the name of the other. For example, with the
> 'keep-alive-idle' option added, the current parser cannot parse
> '127.0.0.1:5000,keep-alive-idle=60,keep-alive' correctly. Instead, it
> fails with "error parsing 'keep-alive' flag '-idle=60,keep-alive'".
>
> To resolve these issues, this patch rewrites the inet address parsing
> using the QemuOpts parser, which the inet_parse_flag() function tries to
> mimic. This new parser supports all previously supported options and on
> top of that the 'numeric' flag is now also supported. The only
> difference is, the new parser produces an error if an unknown option is
> passed, instead of silently ignoring it.
>
> Signed-off-by: Juraj Marcin <jmarcin@redhat.com>
> ---
> tests/unit/test-util-sockets.c | 4 +-
> util/qemu-sockets.c | 158 +++++++++++++++------------------
> 2 files changed, 77 insertions(+), 85 deletions(-)
>
> diff --git a/tests/unit/test-util-sockets.c b/tests/unit/test-util-sockets.c
> index 60f15a4ddf..77d0767b9b 100644
> --- a/tests/unit/test-util-sockets.c
> +++ b/tests/unit/test-util-sockets.c
> @@ -449,6 +449,8 @@ static void test_inet_parse_all_options_good(void)
> InetSocketAddress exp_addr = {
> .host = host,
> .port = port,
> + .has_numeric = true,
> + .numeric = true,
> .has_to = true,
> .to = 5006,
> .has_ipv4 = true,
> @@ -463,7 +465,7 @@ static void test_inet_parse_all_options_good(void)
> #endif
> };
> inet_parse_test_helper(
> - "[::1]:5000,to=5006,ipv4=off,ipv6=on,keep-alive"
> + "[::1]:5000,numeric,to=5006,ipv4=off,ipv6=on,keep-alive"
> #ifdef HAVE_IPPROTO_MPTCP
> ",mptcp"
> #endif
Squash into the previous patch
If you do that, then for the remainder
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2025-05-19 10:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-16 15:56 [PATCH v4 0/7] util/qemu-sockets: Introduce inet socket options controlling TCP keep-alive Juraj Marcin
2025-05-16 15:56 ` [PATCH v4 1/7] io: Fix partial struct copy in qio_dns_resolver_lookup_sync_inet() Juraj Marcin
2025-05-16 15:56 ` [PATCH v4 2/7] util/qemu-sockets: Refactor setting client sockopts into a separate function Juraj Marcin
2025-05-19 10:33 ` Daniel P. Berrangé
2025-05-16 15:56 ` [PATCH v4 3/7] util/qemu-sockets: Refactor success and failure paths in inet_listen_saddr() Juraj Marcin
2025-05-16 15:56 ` [PATCH v4 4/7] util/qemu-sockets: Add support for keep-alive flag to passive sockets Juraj Marcin
2025-05-16 15:56 ` [PATCH v4 5/7] tests/unit/test-util-sockets: Add tests for inet_parse() Juraj Marcin
2025-05-19 10:42 ` Daniel P. Berrangé
2025-05-16 15:56 ` [PATCH v4 6/7] util/qemu-sockets: Refactor inet_parse() to use QemuOpts Juraj Marcin
2025-05-19 10:43 ` Daniel P. Berrangé [this message]
2025-05-16 15:56 ` [PATCH v4 7/7] util/qemu-sockets: Introduce inet socket options controlling TCP keep-alive Juraj Marcin
2025-05-19 10:44 ` Daniel P. Berrangé
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=aCsLWCXlUQyh53LD@redhat.com \
--to=berrange@redhat.com \
--cc=jmarcin@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@yandex-team.ru \
/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.