All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabiano Rosas <farosas@suse.de>
To: qemu-devel@nongnu.org
Cc: "Markus Armbruster" <armbru@redhat.com>,
	"Daniel P . Berrangé" <berrange@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: [PATCH v2 08/11] qemu-option: Use qemu_opts_parse_list_noisily where appropriate
Date: Wed, 30 Sep 2026 19:11:02 -0300	[thread overview]
Message-ID: <20260930221105.2262063-9-farosas@suse.de> (raw)
In-Reply-To: <20260930221105.2262063-1-farosas@suse.de>

Change the callers of qemu_opts_parse_noisily() that currently take a
QemuOptsList pointer to call qemu_opts_parse_list_noisily().

This is done to free up the qemu_opts_parse_noisily() version to be
used to take the group name instead.

Signed-off-by: Fabiano Rosas <farosas@suse.de>
---
 block/monitor/block-hmp-cmds.c       | 2 +-
 monitor/hmp.c                        | 2 +-
 net/net.c                            | 2 +-
 qemu-img.c                           | 8 ++++----
 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 +-
 13 files changed, 26 insertions(+), 25 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/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;
                 }
diff --git a/net/net.c b/net/net.c
index d7fa637ce5..37401ab2b4 100644
--- a/net/net.c
+++ b/net/net.c
@@ -2029,7 +2029,7 @@ void netdev_parse_modern(const char *optstr)
 
 void net_client_parse(QemuOptsList *opts_list, const char *optstr)
 {
-    if (!qemu_opts_parse_noisily(opts_list, optstr, true)) {
+    if (!qemu_opts_parse_list_noisily(opts_list, optstr, true)) {
         exit(1);
     }
 }
diff --git a/qemu-img.c b/qemu-img.c
index 2f63d31141..c645de6462 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -2383,8 +2383,8 @@ static int img_convert(const img_cmd_t *ccmd, int argc, char **argv)
             break;
         case 'l':
             if (strstart(optarg, SNAPSHOT_OPT_BASE, NULL)) {
-                sn_opts = qemu_opts_parse_noisily(&internal_snapshot_opts,
-                                                  optarg, false);
+                sn_opts = qemu_opts_parse_list_noisily(&internal_snapshot_opts,
+                                                       optarg, false);
                 if (!sn_opts) {
                     error_report("Failed in parsing snapshot param '%s'",
                                  optarg);
@@ -5768,8 +5768,8 @@ static int img_measure(const img_cmd_t *ccmd, int argc, char **argv)
             break;
         case 'l':
             if (strstart(optarg, SNAPSHOT_OPT_BASE, NULL)) {
-                sn_opts = qemu_opts_parse_noisily(&internal_snapshot_opts,
-                                                  optarg, false);
+                sn_opts = qemu_opts_parse_list_noisily(&internal_snapshot_opts,
+                                                       optarg, false);
                 if (!sn_opts) {
                     error_report("Failed in parsing snapshot param '%s'",
                                  optarg);
diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c
index aa795fd87a..6c8c4c9540 100644
--- a/qemu-io-cmds.c
+++ b/qemu-io-cmds.c
@@ -2540,7 +2540,7 @@ static int reopen_f(BlockBackend *blk, int argc, char **argv, Error **errp)
             has_cache_option = true;
             break;
         case 'o':
-            if (!qemu_opts_parse_noisily(&reopen_opts, optarg, 0)) {
+            if (!qemu_opts_parse_list_noisily(&reopen_opts, optarg, 0)) {
                 qemu_opts_reset(&reopen_opts);
                 return -EINVAL;
             }
diff --git a/qemu-io.c b/qemu-io.c
index 598d5b1c9c..db0ee499e4 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -220,7 +220,7 @@ static int open_f(BlockBackend *blk, int argc, char **argv, Error **errp)
                 qemu_opts_reset(&empty_opts);
                 return -EINVAL;
             }
-            if (!qemu_opts_parse_noisily(&empty_opts, optarg, false)) {
+            if (!qemu_opts_parse_list_noisily(&empty_opts, optarg, false)) {
                 qemu_opts_reset(&empty_opts);
                 return -EINVAL;
             }
@@ -240,7 +240,7 @@ static int open_f(BlockBackend *blk, int argc, char **argv, Error **errp)
     }
 
     if (imageOpts && (optind == argc - 1)) {
-        if (!qemu_opts_parse_noisily(&empty_opts, argv[optind], false)) {
+        if (!qemu_opts_parse_list_noisily(&empty_opts, argv[optind], false)) {
             qemu_opts_reset(&empty_opts);
             return -EINVAL;
         }
@@ -659,7 +659,8 @@ int main(int argc, char **argv)
     if ((argc - optind) == 1) {
         if (imageOpts) {
             QemuOpts *qopts = NULL;
-            qopts = qemu_opts_parse_noisily(&file_opts, argv[optind], false);
+            qopts = qemu_opts_parse_list_noisily(&file_opts, argv[optind],
+                                                 false);
             if (!qopts) {
                 exit(1);
             }
diff --git a/qemu-nbd.c b/qemu-nbd.c
index ed5895861b..749c915b58 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -706,8 +706,8 @@ int main(int argc, char **argv)
             break;
         case 'l':
             if (strstart(optarg, SNAPSHOT_OPT_BASE, NULL)) {
-                sn_opts = qemu_opts_parse_noisily(&internal_snapshot_opts,
-                                                  optarg, false);
+                sn_opts = qemu_opts_parse_list_noisily(&internal_snapshot_opts,
+                                                       optarg, false);
                 if (!sn_opts) {
                     error_report("Failed in parsing snapshot param `%s'",
                                  optarg);
@@ -1117,7 +1117,7 @@ int main(int argc, char **argv)
             error_report("--image-opts and -f are mutually exclusive");
             exit(EXIT_FAILURE);
         }
-        o = qemu_opts_parse_noisily(&file_opts, opts.srcpath, true);
+        o = qemu_opts_parse_list_noisily(&file_opts, opts.srcpath, true);
         if (!o) {
             qemu_opts_reset(&file_opts);
             exit(EXIT_FAILURE);
diff --git a/storage-daemon/qemu-storage-daemon.c b/storage-daemon/qemu-storage-daemon.c
index 50dbfbd97a..5d63ef2efc 100644
--- a/storage-daemon/qemu-storage-daemon.c
+++ b/storage-daemon/qemu-storage-daemon.c
@@ -283,8 +283,8 @@ static void process_options(int argc, char *argv[], bool pre_init_pass)
         case OPTION_CHARDEV:
             {
                 /* TODO This interface is not stable until we QAPIfy it */
-                QemuOpts *opts = qemu_opts_parse_noisily(&qemu_chardev_opts,
-                                                         optarg, true);
+                QemuOpts *opts = qemu_opts_parse_list_noisily(
+                    &qemu_chardev_opts, optarg, true);
                 if (opts == NULL) {
                     exit(EXIT_FAILURE);
                 }
diff --git a/system/qdev-monitor.c b/system/qdev-monitor.c
index 8185822daa..dc2d9e76bc 100644
--- a/system/qdev-monitor.c
+++ b/system/qdev-monitor.c
@@ -1204,7 +1204,7 @@ int qemu_global_option(const char *str)
         return 0;
     }
 
-    opts = qemu_opts_parse_noisily(&qemu_global_opts, str, false);
+    opts = qemu_opts_parse_list_noisily(&qemu_global_opts, str, false);
     if (!opts) {
         return -1;
     }
diff --git a/system/tpm.c b/system/tpm.c
index 903b29c043..f0f5a64d9a 100644
--- a/system/tpm.c
+++ b/system/tpm.c
@@ -184,7 +184,7 @@ int tpm_config_parse(QemuOptsList *opts_list, const char *optstr)
         tpm_display_backend_drivers();
         exit(EXIT_SUCCESS);
     }
-    opts = qemu_opts_parse_noisily(opts_list, optstr, true);
+    opts = qemu_opts_parse_list_noisily(opts_list, optstr, true);
     if (!opts) {
         return -1;
     }
diff --git a/system/vl.c b/system/vl.c
index 87398cc8d0..bf5146d1c0 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -3277,7 +3277,7 @@ void qemu_init(int argc, char **argv)
                     error_report("fsdev support is disabled");
                     exit(1);
                 }
-                if (!qemu_opts_parse_noisily(olist, optarg, true)) {
+                if (!qemu_opts_parse_list_noisily(olist, optarg, true)) {
                     exit(1);
                 }
                 break;
@@ -3292,7 +3292,7 @@ void qemu_init(int argc, char **argv)
                     error_report("virtfs support is disabled");
                     exit(1);
                 }
-                opts = qemu_opts_parse_noisily(olist, optarg, true);
+                opts = qemu_opts_parse_list_noisily(olist, optarg, true);
                 if (!opts) {
                     exit(1);
                 }
@@ -3644,7 +3644,7 @@ void qemu_init(int argc, char **argv)
                     exit(1);
                 }
 
-                opts = qemu_opts_parse_noisily(olist, optarg, true);
+                opts = qemu_opts_parse_list_noisily(olist, optarg, true);
                 if (!opts) {
                     exit(1);
                 }
diff --git a/tests/unit/test-replication.c b/tests/unit/test-replication.c
index 3aa98e6f56..101f72acdc 100644
--- a/tests/unit/test-replication.c
+++ b/tests/unit/test-replication.c
@@ -179,7 +179,7 @@ static BlockBackend *start_primary(void)
                               "file.driver=qcow2,file.file.filename=%s,"
                               "file.file.locking=off"
                               , p_local_disk);
-    opts = qemu_opts_parse_noisily(&qemu_drive_opts, cmdline, false);
+    opts = qemu_opts_parse_list_noisily(&qemu_drive_opts, cmdline, false);
     g_free(cmdline);
 
     qdict = qemu_opts_to_qdict(opts, NULL);
@@ -295,7 +295,7 @@ static BlockBackend *start_secondary(void)
     cmdline = g_strdup_printf("file.filename=%s,driver=qcow2,"
                               "file.locking=off",
                               s_local_disk);
-    opts = qemu_opts_parse_noisily(&qemu_drive_opts, cmdline, false);
+    opts = qemu_opts_parse_list_noisily(&qemu_drive_opts, cmdline, false);
     g_free(cmdline);
 
     qdict = qemu_opts_to_qdict(opts, NULL);
@@ -321,7 +321,7 @@ static BlockBackend *start_secondary(void)
                               "file.backing.backing=%s"
                               , S_ID, s_active_disk, s_hidden_disk
                               , S_LOCAL_DISK_ID);
-    opts = qemu_opts_parse_noisily(&qemu_drive_opts, cmdline, false);
+    opts = qemu_opts_parse_list_noisily(&qemu_drive_opts, cmdline, false);
     g_free(cmdline);
 
     qdict = qemu_opts_to_qdict(opts, NULL);
diff --git a/tools/qemu-vnc/qemu-vnc.c b/tools/qemu-vnc/qemu-vnc.c
index 5c2ba3b7a5..10ac76298a 100644
--- a/tools/qemu-vnc/qemu-vnc.c
+++ b/tools/qemu-vnc/qemu-vnc.c
@@ -377,7 +377,7 @@ setup_vnc_opts(const char *vnc_addr, const char *tls_creds_dir,
         g_string_append(opts_str, ",non-adaptive=on");
     }
 
-    opts = qemu_opts_parse_noisily(olist, opts_str->str, true);
+    opts = qemu_opts_parse_list_noisily(olist, opts_str->str, true);
     if (!opts) {
         return false;
     }
-- 
2.53.0



  parent reply	other threads:[~2026-09-30 22:13 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-30 22:10 [PATCH v2 00/11] qemu-options: Spring cleanup Fabiano Rosas
2026-09-30 22:10 ` [PATCH v2 01/11] qemu-option: Use g_autofree when calling get_opt_name_value() Fabiano Rosas
2026-10-01  9:42   ` marcandre.lureau
2026-09-30 22:10 ` [PATCH v2 02/11] tests/unit/test-qemu-opts: Validate help=foo options Fabiano Rosas
2026-10-01  9:42   ` marcandre.lureau
2026-09-30 22:10 ` [PATCH v2 03/11] qemu-option: Remove short form options support Fabiano Rosas
2026-10-01  9:42   ` marcandre.lureau
2026-10-07  7:08   ` Markus Armbruster
2026-10-07 12:43     ` Fabiano Rosas
2026-10-08  4:42       ` Markus Armbruster
2026-10-10  0:04         ` Fabiano Rosas
2026-10-07  8:16   ` Markus Armbruster
2026-09-30 22:10 ` [PATCH v2 04/11] qemu-option: Fix 'help' parameter parsing Fabiano Rosas
2026-10-01  9:42   ` marcandre.lureau
2026-10-01 15:43     ` Fabiano Rosas
2026-09-30 22:10 ` [PATCH v2 05/11] qemu-option: Add qemu_opts_parse_list Fabiano Rosas
2026-10-01  9:42   ` marcandre.lureau
2026-09-30 22:11 ` [PATCH v2 06/11] qemu-option: Change qemu_parse_opts() to take the group name Fabiano Rosas
2026-10-01  9:42   ` marcandre.lureau
2026-09-30 22:11 ` [PATCH v2 07/11] qemu-option: Add qemu_opts_parse_list_noisily Fabiano Rosas
2026-10-01  9:42   ` marcandre.lureau
2026-10-07 12:54   ` Eric Blake
2026-09-30 22:11 ` Fabiano Rosas [this message]
2026-10-01  9:42   ` [PATCH v2 08/11] qemu-option: Use qemu_opts_parse_list_noisily where appropriate marcandre.lureau
2026-09-30 22:11 ` [PATCH v2 09/11] qemu-option: Change qemu_opts_parse_noisily() to take the group Fabiano Rosas
2026-10-01  9:42   ` marcandre.lureau
2026-10-07 12:54   ` Eric Blake
2026-09-30 22:11 ` [PATCH v2 10/11] qemu-option: Check for NULL list at qemu_opts_parse() Fabiano Rosas
2026-10-01  9:42   ` marcandre.lureau
2026-09-30 22:11 ` [PATCH v2 11/11] qemu-option: Remove a few instances of noisily parsing Fabiano Rosas
2026-10-01  9:42   ` marcandre.lureau

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=20260930221105.2262063-9-farosas@suse.de \
    --to=farosas@suse.de \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=dave@treblig.org \
    --cc=eblake@redhat.com \
    --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.