build_library/qemu_template.sh: exec qemu instead of calling it

This change updates the build library's qemu template to "exec" qemu instead of calling it from the script. While serving the same purpose as calling qemu and returning "$?" (the current implementation), using exec makes it easier to manage the qemu sub-process when the qemu wrapper script is called from another script.
This commit is contained in:
Thilo Fromm 2025-07-01 09:21:39 +02:00 committed by GitHub
parent 6f5eed7686
commit 447780652c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -332,12 +332,10 @@ case "${VM_BOARD}" in
*) die "Unsupported arch" ;;
esac
"$QEMU_BIN" \
exec "$QEMU_BIN" \
-name "$VM_NAME" \
-m ${VM_MEMORY} \
-netdev user,id=eth0${QEMU_FORWARDED_PORTS:+,}${QEMU_FORWARDED_PORTS},hostfwd=tcp::"${SSH_PORT}"-:22,hostname="${VM_NAME}" \
-device virtio-net-pci,netdev=eth0 \
-object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0 \
"$@"
exit $?