]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
refactor(run-qemu): group serial and log file handling
authorBenjamin Drung <benjamin.drung@canonical.com>
Sat, 24 Jan 2026 16:53:50 +0000 (17:53 +0100)
committerLaszlo <laszlo.gombos@gmail.com>
Sat, 24 Jan 2026 17:15:36 +0000 (12:15 -0500)
Configuring `-serial` to write to `stdout` and writing to the a QEMU log
file belongs together.

test/run-qemu

index f6ef16b4ccd6050346d35486744b7571e2749c7d..8bfd86c73a64205174083b7d4f75de3a4e9a7618 100755 (executable)
@@ -174,10 +174,6 @@ fi
 # Provide rng device sourcing the hosts /dev/urandom and other standard parameters
 ARGS+=(-smp 2 -m "${MEMORY-1024}" -nodefaults -vga none -display none -no-reboot -watchdog-action poweroff -device "${rng_device:-virtio-rng-pci}")
 
-if ! [[ $* == *-daemonize* ]]; then
-    ARGS+=(-serial stdio)
-fi
-
 # virtual hardware watchdog not available on s390x
 if [[ $ARCH != "s390x" ]]; then
     ARGS+=(-device i6300esb)
@@ -201,6 +197,7 @@ if ! [[ $* == *-daemonize* ]] && timeout --help 2> /dev/null | grep -q -- --fore
 fi
 
 if ! [[ $* == *-daemonize* ]]; then
+    ARGS+=(-serial stdio)
     if [[ ${QEMU_LOGFILE-} ]]; then
         exec > >(tee "$QEMU_LOGFILE")
     fi