Skip to content

Commit 0f0fa2f

Browse files
John15321tormath1
andcommitted
fix: Dynamically create netdev arguments to correctly include commas
docs: Add entrance to the changelog about the fix Update changelog/changes/2025-01-15-qemu-startup-script-comma-fix.md Co-authored-by: Mathieu Tortuyaux <[email protected]>
1 parent 80e36c7 commit 0f0fa2f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

build_library/qemu_template.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ case "${VM_BOARD}" in
302302
qemu-system-x86_64 \
303303
-name "$VM_NAME" \
304304
-m ${VM_MEMORY} \
305-
-netdev user,id=eth0,${QEMU_FORWARDED_PORTS},hostfwd=tcp::"${SSH_PORT}"-:22,hostname="${VM_NAME}" \
305+
-netdev user,id=eth0${QEMU_FORWARDED_PORTS:+,}${QEMU_FORWARDED_PORTS},hostfwd=tcp::"${SSH_PORT}"-:22,hostname="${VM_NAME}" \
306306
-device virtio-net-pci,netdev=eth0 \
307307
-object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0 \
308308
"$@"
@@ -311,7 +311,7 @@ case "${VM_BOARD}" in
311311
qemu-system-aarch64 \
312312
-name "$VM_NAME" \
313313
-m ${VM_MEMORY} \
314-
-netdev user,id=eth0,${QEMU_FORWARDED_PORTS},hostfwd=tcp::"${SSH_PORT}"-:22,hostname="${VM_NAME}" \
314+
-netdev user,id=eth0${QEMU_FORWARDED_PORTS:+,}${QEMU_FORWARDED_PORTS},hostfwd=tcp::"${SSH_PORT}"-:22,hostname="${VM_NAME}" \
315315
-device virtio-net-device,netdev=eth0 \
316316
-object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0 \
317317
"$@"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Fixed creating netdev arguments to correctly include commas when no port forwards are passed ([flatcar/scripts#2581](https://github.com/flatcar/scripts/pull/2581))

0 commit comments

Comments
 (0)