Redirect serial output if `hvc0` is on
This commit is contained in:
parent
a4f77b12b6
commit
6d2ff13a63
|
|
@ -14,6 +14,7 @@ target/
|
||||||
|
|
||||||
# qemu log file
|
# qemu log file
|
||||||
qemu.log
|
qemu.log
|
||||||
|
qemu-serial.log
|
||||||
|
|
||||||
# packet dump file
|
# packet dump file
|
||||||
virtio-net.pcap
|
virtio-net.pcap
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,10 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$CONSOLE" = "hvc0" ]; then
|
if [ "$CONSOLE" = "hvc0" ]; then
|
||||||
CONSOLE_ARGS="-device virtconsole,chardev=mux"
|
# Kernel logs are printed to all consoles. Redirect serial output to a file to avoid duplicate logs.
|
||||||
|
CONSOLE_ARGS="-device virtconsole,chardev=mux -serial file:qemu-serial.log"
|
||||||
|
else
|
||||||
|
CONSOLE_ARGS="-serial chardev:mux"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$1" = "tdx" ]; then
|
if [ "$1" = "tdx" ]; then
|
||||||
|
|
@ -75,7 +78,6 @@ if [ "$1" = "tdx" ]; then
|
||||||
$CONSOLE_ARGS \
|
$CONSOLE_ARGS \
|
||||||
-device isa-debug-exit,iobase=0xf4,iosize=0x04 \
|
-device isa-debug-exit,iobase=0xf4,iosize=0x04 \
|
||||||
-monitor chardev:mux \
|
-monitor chardev:mux \
|
||||||
-serial chardev:mux \
|
|
||||||
-d guest_errors \
|
-d guest_errors \
|
||||||
"
|
"
|
||||||
echo $QEMU_ARGS
|
echo $QEMU_ARGS
|
||||||
|
|
@ -89,7 +91,6 @@ COMMON_QEMU_ARGS="\
|
||||||
--no-reboot \
|
--no-reboot \
|
||||||
-nographic \
|
-nographic \
|
||||||
-display vnc=0.0.0.0:${VNC_PORT:-42} \
|
-display vnc=0.0.0.0:${VNC_PORT:-42} \
|
||||||
-serial chardev:mux \
|
|
||||||
-monitor chardev:mux \
|
-monitor chardev:mux \
|
||||||
-chardev stdio,id=mux,mux=on,signal=off,logfile=qemu.log \
|
-chardev stdio,id=mux,mux=on,signal=off,logfile=qemu.log \
|
||||||
$NETDEV_ARGS \
|
$NETDEV_ARGS \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue