qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org
Cc: Stefan Hajnoczi <stefanha@redhat.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	Yihuan Pan <xun794@gmail.com>
Subject: [PULL 15/19] qemu-options: Clarify handling of commas in options parameters
Date: Wed, 20 Dec 2023 10:41:01 +0100	[thread overview]
Message-ID: <20231220094105.6588-16-thuth@redhat.com> (raw)
In-Reply-To: <20231220094105.6588-1-thuth@redhat.com>

From: Yihuan Pan <xun794@gmail.com>

Provide explicit guidance on dealing with option parameters as arbitrary
strings containing commas, such as in "file=my,file" and "string=a,b". The
updated documentation emphasizes the need to double commas when they
appear within such parameters.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1839
Signed-off-by: Yihuan Pan <xun794@gmail.com>
Message-ID: <20231213141706.629833-2-xun794@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 docs/system/invocation.rst   | 5 +++++
 docs/system/qemu-manpage.rst | 5 +++++
 qemu-options.hx              | 4 ++++
 3 files changed, 14 insertions(+)

diff --git a/docs/system/invocation.rst b/docs/system/invocation.rst
index 4ba38fc23d..14b7db1c10 100644
--- a/docs/system/invocation.rst
+++ b/docs/system/invocation.rst
@@ -10,6 +10,11 @@ Invocation
 disk_image is a raw hard disk image for IDE hard disk 0. Some targets do
 not need a disk image.
 
+When dealing with options parameters as arbitrary strings containing
+commas, such as in "file=my,file" and "string=a,b", it's necessary to
+double the commas. For instance,"-fw_cfg name=z,string=a,,b" will be
+parsed as "-fw_cfg name=z,string=a,b".
+
 .. hxtool-doc:: qemu-options.hx
 
 Device URL Syntax
diff --git a/docs/system/qemu-manpage.rst b/docs/system/qemu-manpage.rst
index c47a412758..3ade4ee45b 100644
--- a/docs/system/qemu-manpage.rst
+++ b/docs/system/qemu-manpage.rst
@@ -31,6 +31,11 @@ Options
 disk_image is a raw hard disk image for IDE hard disk 0. Some targets do
 not need a disk image.
 
+When dealing with options parameters as arbitrary strings containing
+commas, such as in "file=my,file" and "string=a,b", it's necessary to
+double the commas. For instance,"-fw_cfg name=z,string=a,,b" will be
+parsed as "-fw_cfg name=z,string=a,b".
+
 .. hxtool-doc:: qemu-options.hx
 
 .. include:: keys.rst.inc
diff --git a/qemu-options.hx b/qemu-options.hx
index 42fd09e4de..a935aaae44 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -4086,9 +4086,13 @@ DEF("fw_cfg", HAS_ARG, QEMU_OPTION_fwcfg,
 SRST
 ``-fw_cfg [name=]name,file=file``
     Add named fw\_cfg entry with contents from file file.
+    If the filename contains comma, you must double it (for instance,
+    "file=my,,file" to use file "my,file").
 
 ``-fw_cfg [name=]name,string=str``
     Add named fw\_cfg entry with contents from string str.
+    If the string contains comma, you must double it (for instance,
+    "string=my,,string" to use file "my,string").
 
     The terminating NUL character of the contents of str will not be
     included as part of the fw\_cfg item data. To insert contents with
-- 
2.43.0



  parent reply	other threads:[~2023-12-20  9:42 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-20  9:40 [PULL 00/19] First batch of misc patches for QEMU 9.0 Thomas Huth
2023-12-20  9:40 ` [PULL 01/19] hw: Add compat machines for 9.0 Thomas Huth
2023-12-20  9:40 ` [PULL 02/19] MAINTAINERS: Add some more vmware-related files to the corresponding section Thomas Huth
2023-12-20  9:40 ` [PULL 03/19] system/qtest: Include missing 'hw/core/cpu.h' header Thomas Huth
2023-12-20  9:40 ` [PULL 04/19] system/qtest: Restrict QTest API to system emulation Thomas Huth
2023-12-20  9:40 ` [PULL 05/19] hw/ppc/spapr_hcall: Remove unused 'exec/exec-all.h' included header Thomas Huth
2023-12-20  9:40 ` [PULL 06/19] hw/misc/mips_itu: Remove unnecessary 'exec/exec-all.h' header Thomas Huth
2023-12-20  9:40 ` [PULL 07/19] hw/s390x/ipl: Remove unused 'exec/exec-all.h' included header Thomas Huth
2023-12-20  9:40 ` [PULL 08/19] target: Restrict 'sysemu/reset.h' to system emulation Thomas Huth
2023-12-20  9:40 ` [PULL 09/19] docs/system/arm: Fix for rename of type "xlnx.bbram-ctrl" Thomas Huth
2023-12-20  9:40 ` [PULL 10/19] hw: Replace anti-social QOM type names (again) Thomas Huth
2023-12-20  9:40 ` [PULL 11/19] memory: Remove "qemu:" prefix from the "qemu:ram-discard-manager" type name Thomas Huth
2023-12-20  9:40 ` [PULL 12/19] tests/unit/test-io-task: Rename "qemu:dummy" to avoid colon in the name Thomas Huth
2023-12-20  9:40 ` [PULL 13/19] qom/object: Limit type names to alphanumerical and some few special characters Thomas Huth
2023-12-20  9:41 ` [PULL 14/19] tests/qtest/migration-test: Fix analyze-migration.py for s390x Thomas Huth
2023-12-20  9:41 ` Thomas Huth [this message]
2023-12-20  9:41 ` [PULL 16/19] tests/qtest/npcm7xx_pwm-test: Only do full testing in slow mode Thomas Huth
2023-12-20  9:41 ` [PULL 17/19] tests/unit/test-qmp-event: Drop superfluous mutex Thomas Huth
2023-12-20  9:41 ` [PULL 18/19] tests/unit/test-qmp-event: Simplify event emission check Thomas Huth
2023-12-20  9:41 ` [PULL 19/19] tests/unit/test-qmp-event: Replace fixture by global variables Thomas Huth
2023-12-20 16:03 ` [PULL 00/19] First batch of misc patches for QEMU 9.0 Stefan Hajnoczi
2023-12-20 23:11   ` Alex Bennée
2023-12-21  0:09     ` Stefan Hajnoczi

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=20231220094105.6588-16-thuth@redhat.com \
    --to=thuth@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=xun794@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).