summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorKevin Hao <kexin.hao@windriver.com>2019-06-06 15:11:46 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-06-07 09:10:33 +0100
commit766c3b56e5071b5a5a64e88df6d3abe5232dd958 (patch)
tree401c29c6deb75d9e2d1d31c516aabddee1dd7bbd /scripts
parent43e55bfa040425cf93d94ac626a31f6fd00a7a74 (diff)
downloadopenembedded-core-contrib-766c3b56e5071b5a5a64e88df6d3abe5232dd958.tar.gz
runqemu: Add the support to pass multi ports to tcpserial parameter
In some cases(such as the oeqa's qemurunner), we need to setup multi serial devices via the '-serial 127.0.0.1:xx" and the order of them is significant. The mixing use of "tcpserial" and "-serial 127.0.0.1:xx" cause ambiguous issues and we can't fix it by only adjusting the order of them. So add the support to pass multi ports to the tcpserial parameter, this will make sure that the order of setting up the serial is really what we want. [YOCTO Bug 13309] Signed-off-by: Kevin Hao <kexin.hao@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/runqemu12
1 files changed, 9 insertions, 3 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index 5752ecda73..af90c010da 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -438,7 +438,7 @@ class BaseConfig(object):
elif arg == 'publicvnc':
self.qemu_opt_script += ' -vnc :0'
elif arg.startswith('tcpserial='):
- self.tcpserial_portnum = arg[len('tcpserial='):]
+ self.tcpserial_portnum = '%s' % arg[len('tcpserial='):]
elif arg.startswith('biosdir='):
self.custombiosdir = arg[len('biosdir='):]
elif arg.startswith('biosfilename='):
@@ -682,10 +682,16 @@ class BaseConfig(object):
def check_tcpserial(self):
if self.tcpserial_portnum:
+ ports = self.tcpserial_portnum.split(':')
+ port = ports[0]
if self.get('QB_TCPSERIAL_OPT'):
- self.qemu_opt_script += ' ' + self.get('QB_TCPSERIAL_OPT').replace('@PORT@', self.tcpserial_portnum)
+ self.qemu_opt_script += ' ' + self.get('QB_TCPSERIAL_OPT').replace('@PORT@', port)
else:
- self.qemu_opt_script += ' -serial tcp:127.0.0.1:%s' % self.tcpserial_portnum
+ self.qemu_opt_script += ' -serial tcp:127.0.0.1:%s' % port
+
+ if len(ports) > 1:
+ for port in ports[1:]:
+ self.qemu_opt_script += ' -serial tcp:127.0.0.1:%s' % port
def check_and_set(self):
"""Check configs sanity and set when needed"""