Repository navigation
Conversation
The unquoted ${ARGS:+ $ARGS} expansion word-splits on whitespace and
never removes quotes, so an argument containing a space cannot be
passed. Read extra arguments from ARGS_FILE (one per line) into the
command array instead, which preserves each argument verbatim.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
|
Yes, this is a known issue. But luckily it never caused much problems for users since it is pretty rare to have QEMU parameters to have spaces for most usecases. In any case it needs to be fixed in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Defect
src/entry.sh(lines 59, 63, 66 on master 1e99833) launches QEMU with:Because
$ARGSis unquoted it is word-split on whitespace, and quotes inside it are not removed, so a QEMU argument containing a space cannot be passed (e.g.-device foo,bar="a b"). Minimal repro (same expansion, printing argv):Output:
Fix
Add an optional
ARGS_FILEvariable: a file with one QEMU argument per line, appended verbatim to thecmdarray (empty lines skipped).ARGS/ARGUMENTSbehave as before, so nothing existing changes. Documented indocs/environment.md.Testing
shellcheck(0.11.0, with the flags from.github/workflows/check.yml) is clean onsrc/entry.sh.-device,foo,bar="a b", an empty line,-name,my vm: argv is-device,foo,bar="a b",-name,my vm.🤖 Generated with Claude Code