runqemu: Add a tcpserial option

The option was added so that the qemurunner could start a second tcp
serial port without adding machine conditional logic to qemurunner.

The issue that made this necessary was that when "virt" is passed to
qemu-system-aarch64, the normal mechanism for specifying a tcp serial
port does not work. This is because the hardware for the "virt" machine
is hardcoded in the device tree blob and the addition devices must be
virtio devices.

So runqemu can specify virtio for qemuarm64 whereas it seems all other
qemu machines work with the "-serial tcp*" option.

(From OE-Core rev: 849d65d55e4df5fa443b2cb7b4cee23913fc9d5a)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Randy Witt authored and Richard Purdie committed 2015-08-24 23:47:07 +01:00
1 parent fd164dcc31
commit d893a2503d
3 files changed
+14 -2

No files matched your search

+4
View File
@@ -68,6 +68,7 @@ SCRIPT_QEMU_OPT=""
SCRIPT_QEMU_EXTRA_OPT=""
SCRIPT_KERNEL_OPT=""
SERIALSTDIO=""
TCPSERIAL_PORTNUM=""
KVM_ENABLED="no"
KVM_ACTIVE="no"
@@ -150,6 +151,9 @@ while true; do
SCRIPT_KERNEL_OPT="$SCRIPT_KERNEL_OPT console=ttyS0"
SERIALSTDIO="1"
;;
"tcpserial="*)
TCPSERIAL_PORTNUM=${arg##tcpserial=}
;;
"biosdir="*)
CUSTOMBIOSDIR="${arg##biosdir=}"
;;
+8
View File
@@ -620,6 +620,14 @@ if [ "x$QEMUOPTIONS" = "x" ]; then
return 1
fi
if [ $TCPSERIAL_PORTNUM != "" ]; then
if [ "$MACHINE" = "qemuarm64" ]; then
QEMUOPTIONS="$QEMUOPTIONS -device virtio-serial-device -chardev socket,id=virtcon,port=$TCPSERIAL_PORTNUM,host=127.0.0.1 -device virtconsole,chardev=virtcon"
else
QEMUOPTIONS="$QEMUOPTIONS -serial tcp:127.0.0.1:$TCPSERIAL_PORTNUM"
fi
fi
PATH=$OECORE_NATIVE_SYSROOT/usr/bin:$PATH
QEMUBIN=`which $QEMU 2> /dev/null`