Skip to content

Commit c2d18cf

Browse files
authored
Merge pull request #2581 from John15321/fix-port-forwarding-qemustartscript
fix: Dynamically create netdev arguments to correctly include commas
2 parents cc1d4cd + 0f0fa2f commit c2d18cf

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)