From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Fabiano Rosas <farosas@suse.de>
Cc: qemu-devel@nongnu.org, "Markus Armbruster" <armbru@redhat.com>,
"Kevin Wolf" <kwolf@redhat.com>,
"Hanna Reitz" <hreitz@redhat.com>,
"Dr. David Alan Gilbert" <dave@treblig.org>,
"Jason Wang" <jasowangio@gmail.com>,
"Eric Blake" <eblake@redhat.com>,
"Vladimir Sementsov-Ogievskiy" <vsementsov@yandex-team.ru>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Stefan Berger" <stefanb@linux.vnet.ibm.com>,
"Lukas Straub" <lukasstraub2@web.de>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: Re: [RFC PATCH 08/14] qemu-options: Add qemu_opts_parse_list_noisily
Date: Fri, 25 Sep 2026 11:25:32 +0100 [thread overview]
Message-ID: <arZMHEVA1XavV2I1@redhat.com> (raw)
In-Reply-To: <20260918223002.1892021-9-farosas@suse.de>
On Fri, Sep 18, 2026 at 07:29:55PM -0300, Fabiano Rosas wrote:
> Add a wrapper similar to qemu_opts_parse_list() with the same
> objective, to free the non _list version,
> i.e. qemu_opts_parse_noisily() to be converted to receive the group
> name.
>
> Signed-off-by: Fabiano Rosas <farosas@suse.de>
> ---
> block/monitor/block-hmp-cmds.c | 2 +-
> include/qemu/option.h | 2 ++
> monitor/hmp.c | 2 +-
> net/net.c | 2 +-
> qemu-img.c | 10 +++++-----
> qemu-io-cmds.c | 2 +-
> qemu-io.c | 7 ++++---
> qemu-nbd.c | 6 +++---
> storage-daemon/qemu-storage-daemon.c | 4 ++--
> system/qdev-monitor.c | 2 +-
> system/tpm.c | 2 +-
> system/vl.c | 6 +++---
> tests/unit/test-replication.c | 6 +++---
> tools/qemu-vnc/qemu-vnc.c | 2 +-
> util/qemu-option.c | 14 ++++++++++++++
> 15 files changed, 43 insertions(+), 26 deletions(-)
>
> diff --git a/block/monitor/block-hmp-cmds.c b/block/monitor/block-hmp-cmds.c
> index 7bae4d425c..cbd64166ec 100644
> --- a/block/monitor/block-hmp-cmds.c
> +++ b/block/monitor/block-hmp-cmds.c
> @@ -63,7 +63,7 @@ static void hmp_drive_add_node(MonitorHMP *hmp, const char *optstr)
> QDict *qdict;
> Error *err = NULL;
>
> - opts = qemu_opts_parse_noisily(&qemu_drive_opts, optstr, false);
> + opts = qemu_opts_parse_list_noisily(&qemu_drive_opts, optstr, false);
> if (!opts) {
> return;
> }
> diff --git a/include/qemu/option.h b/include/qemu/option.h
> index dfe0d9b893..df68da9aa8 100644
> --- a/include/qemu/option.h
> +++ b/include/qemu/option.h
> @@ -134,6 +134,8 @@ QemuOpts *qemu_opts_parse(const char *group, const char *params,
> bool permit_abbrev, Error **errp);
> QemuOpts *qemu_opts_parse_list(QemuOptsList *list, const char *params,
> bool permit_abbrev, Error **errp);
> +QemuOpts *qemu_opts_parse_list_noisily(QemuOptsList *list, const char *params,
> + bool permit_abbrev);
> QemuOpts *qemu_opts_from_qdict(QemuOptsList *list, const QDict *qdict,
> Error **errp);
> QDict *qemu_opts_to_qdict_filtered(QemuOpts *opts, QDict *qdict,
This is adding a new function and not removing an existnig function, but....
> diff --git a/monitor/hmp.c b/monitor/hmp.c
> index 488ec23937..fc32cfd1ff 100644
> --- a/monitor/hmp.c
> +++ b/monitor/hmp.c
> @@ -897,7 +897,7 @@ static QDict *monitor_parse_arguments(MonitorHMP *mon,
> if (get_str(buf, sizeof(buf), &p) < 0) {
> goto fail;
> }
> - opts = qemu_opts_parse_noisily(opts_list, buf, true);
> + opts = qemu_opts_parse_list_noisily(opts_list, buf, true);
> if (!opts) {
> goto fail;
> }
...then the patch changes alot of callers to the new
function, which wasn't mentioned in the commit message.
Did you accidentally squash two patches together ? I'd
suggest the conversion of callers should be separate.
> diff --git a/qemu-img.c b/qemu-img.c
> index 2f63d31141..4996618a4e 100644
> --- a/qemu-img.c
> +++ b/qemu-img.c
> @@ -161,7 +161,7 @@ static OutputFormat parse_output_format(const char *argv0, const char *arg)
> * an odd number of ',' (or else a separating ',' following it gets
> * escaped), or be empty (or else a separating ',' preceding it can
> * escape a separating ',' following it).
> - *
> + *
> */
> static bool is_valid_option_list(const char *list)
> {
Extraneous change
> diff --git a/util/qemu-option.c b/util/qemu-option.c
> index c8e552823b..c762eb20a3 100644
> --- a/util/qemu-option.c
> +++ b/util/qemu-option.c
> @@ -971,6 +971,20 @@ QemuOpts *qemu_opts_parse_noisily(QemuOptsList *list, const char *params,
> return qemu_opts_parse_list(list, params, permit_abbrev, NULL);
> }
>
> +/**
> + * Create a QemuOpts in @list and with options parsed from @params.
> + * If @permit_abbrev, the first key=value in @params may omit key=,
> + * and is treated as if key was @list->implied_opt_name.
> + * Report errors with error_report_err(). This is inappropriate in
> + * QMP context. Do not use this function there!
> + * Return the new QemuOpts on success, null pointer on error.
> + */
> +QemuOpts *qemu_opts_parse_list_noisily(QemuOptsList *list, const char *params,
> + bool permit_abbrev)
> +{
> + return qemu_opts_parse_list(list, params, permit_abbrev, NULL);
> +}
I guess this is why you moved the error reporting in the previous
patch. Personally I'd skip the previous patch and accept the
small duplicate code pattern between the two "noisily" methods.
> +
> static bool qemu_opts_from_qdict_entry(QemuOpts *opts,
> const QDictEntry *entry,
> Error **errp)
> --
> 2.53.0
>
With regards,
Daniel
--
|: https://berrange.com ~~ https://hachyderm.io/@berrange :|
|: https://libvirt.org ~~ https://entangle-photo.org :|
|: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
next prev parent reply other threads:[~2026-09-25 10:26 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-18 22:29 [RFC PATCH 00/14] qemu-options: Remove some complexity Fabiano Rosas
2026-09-18 22:29 ` [RFC PATCH 01/14] meson: Fix meson suites invocation from make check Fabiano Rosas
2026-09-25 12:14 ` Fabiano Rosas
2026-09-18 22:29 ` [RFC PATCH 02/14] qemu-options: Use g_autofree when calling get_opt_name_value() Fabiano Rosas
2026-09-25 10:05 ` Daniel P. Berrangé
2026-09-18 22:29 ` [RFC PATCH 03/14] qemu-options: Consolidate branches in opts_parse Fabiano Rosas
2026-09-25 10:07 ` Daniel P. Berrangé
2026-09-18 22:29 ` [RFC PATCH 04/14] qemu-options: Add qemu_opts_parse_list Fabiano Rosas
2026-09-25 10:14 ` Daniel P. Berrangé
2026-09-18 22:29 ` [RFC PATCH 05/14] qemu-options: Change qemu_parse_opts() to take the group name Fabiano Rosas
2026-09-25 10:11 ` Daniel P. Berrangé
2026-09-18 22:29 ` [RFC PATCH 06/14] qemu-options: Call qemu_opts_print_help() one level down Fabiano Rosas
2026-09-25 10:15 ` Daniel P. Berrangé
2026-09-18 22:29 ` [RFC PATCH 07/14] qemu-options: Consolidate qemu_opts_parse* functions Fabiano Rosas
2026-09-25 10:21 ` Daniel P. Berrangé
2026-09-25 12:21 ` Fabiano Rosas
2026-09-28 10:41 ` Daniel P. Berrangé
2026-09-28 14:52 ` Fabiano Rosas
2026-09-18 22:29 ` [RFC PATCH 08/14] qemu-options: Add qemu_opts_parse_list_noisily Fabiano Rosas
2026-09-25 10:25 ` Daniel P. Berrangé [this message]
2026-09-18 22:29 ` [RFC PATCH 09/14] qemu-options: Change qemu_opts_parse_noisily() to take the group Fabiano Rosas
2026-09-21 13:51 ` Stefan Hajnoczi
2026-09-25 10:27 ` Daniel P. Berrangé
2026-09-18 22:29 ` [RFC PATCH 10/14] qemu-options: Check for NULL list at qemu_opts_parse() Fabiano Rosas
2026-09-25 10:28 ` Daniel P. Berrangé
2026-09-18 22:29 ` [RFC PATCH 11/14] qemu-options: pass an Error into get_opt_name_value Fabiano Rosas
2026-09-25 10:35 ` Daniel P. Berrangé
2026-09-18 22:29 ` [RFC PATCH 12/14] qemu-options: merge warn and help flags Fabiano Rosas
2026-09-18 22:30 ` [RFC PATCH 13/14] qemu-options: Further simplify qemu_opts_parse_list() Fabiano Rosas
2026-09-18 22:30 ` [RFC PATCH 14/14] qemu-options: Remove opts_parse() Fabiano Rosas
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=arZMHEVA1XavV2I1@redhat.com \
--to=berrange@redhat.com \
--cc=armbru@redhat.com \
--cc=dave@treblig.org \
--cc=eblake@redhat.com \
--cc=farosas@suse.de \
--cc=hreitz@redhat.com \
--cc=jasowangio@gmail.com \
--cc=kwolf@redhat.com \
--cc=lukasstraub2@web.de \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanb@linux.vnet.ibm.com \
--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.