diff options
-rwxr-xr-x | scripts/runqemu-internal | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/scripts/runqemu-internal b/scripts/runqemu-internal index d6b1102008..078545e931 100755 --- a/scripts/runqemu-internal +++ b/scripts/runqemu-internal | |||
@@ -700,6 +700,38 @@ if [ "x$SERIALSTDIO" = "x1" ]; then | |||
700 | stty intr ^] | 700 | stty intr ^] |
701 | fi | 701 | fi |
702 | 702 | ||
703 | |||
704 | # Preserve the multiplexing behavior for the monitor that would be there based | ||
705 | # on whether nographic is used. | ||
706 | if echo "$QEMUOPTIONS $SERIALOPTS $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT" | grep -- "-nographic"; then | ||
707 | FIRST_SERIAL_OPT="-serial mon:stdio" | ||
708 | else | ||
709 | FIRST_SERIAL_OPT="-serial mon:vc" | ||
710 | fi | ||
711 | |||
712 | # qemuarm64 uses virtio for any additional serial ports so the normal mechanism | ||
713 | # of using -serial will not work | ||
714 | if [ "$MACHINE" = "qemuarm64" ]; then | ||
715 | SECOND_SERIAL_OPT="$SCRIPT_QEMU_EXTRA_OPT -device virtio-serial-device -chardev null,id=virtcon -device virtconsole,chardev=virtcon" | ||
716 | else | ||
717 | SECOND_SERIAL_OPT="-serial null" | ||
718 | fi | ||
719 | |||
720 | # We always want a ttyS1. Since qemu by default adds a serial port when | ||
721 | # nodefaults is not specified, it seems that all that would be needed is to | ||
722 | # make sure a "-serial" is there. However, it appears that when "-serial" is | ||
723 | # specified, it ignores the default serial port that is normally added. | ||
724 | # So here we make sure to add two -serial if there are none. And only one | ||
725 | # if there is one -serial already. | ||
726 | NUM_SERIAL_OPTS=`echo $QEMUOPTIONS $SERIALOPTS $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT | sed -e 's/ /\n/g' | grep --count -- -serial` | ||
727 | |||
728 | if [ "$NUM_SERIAL_OPTS" = "0" ]; then | ||
729 | SCRIPT_QEMU_EXTRA_OPT="$SCRIPT_QEMU_EXTRA_OPT $FIRST_SERIAL_OPT $SECOND_SERIAL_OPT" | ||
730 | elif [ "$NUM_SERIAL_OPTS" = "1" ]; then | ||
731 | SCRIPT_QEMU_EXTRA_OPT="$SCRIPT_QEMU_EXTRA_OPT $SECOND_SERIAL_OPT" | ||
732 | fi | ||
733 | |||
734 | |||
703 | echo "Running $QEMU..." | 735 | echo "Running $QEMU..." |
704 | # -no-reboot is a mandatory option - see bug #100 | 736 | # -no-reboot is a mandatory option - see bug #100 |
705 | if [ "$FSTYPE" = "vmdk" -o "$FSTYPE" = "hddimg" -o "$FSTYPE" = "hdddirect" ]; then | 737 | if [ "$FSTYPE" = "vmdk" -o "$FSTYPE" = "hddimg" -o "$FSTYPE" = "hdddirect" ]; then |