summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils/qemurunner.py
diff options
context:
space:
mode:
authorMikko Rapeli <mikko.rapeli@linaro.org>2023-02-09 10:09:33 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-02-10 09:25:44 +0000
commitd61df4b2208a01702ffab344a237cfb2be5d4972 (patch)
treecfe13d292e1ee3dc3bb1d6dc886404acc10a9dc9 /meta/lib/oeqa/utils/qemurunner.py
parent49da864246bc1af80027698ece68769faaed1d09 (diff)
downloadpoky-d61df4b2208a01702ffab344a237cfb2be5d4972.tar.gz
oeqa qemurunner: read more data at a time from serial
Use a short sleep to bundle serial console reads so that we are not reading one character at a time which reduces busy looping. (From OE-Core rev: cafe65d8cf7544edbd387f7f5f6d77c64c6b18fa) Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/utils/qemurunner.py')
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 8b893601d4..2e054447fc 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -202,7 +202,7 @@ class QemuRunner:
202 qmp_file = "." + next(tempfile._get_candidate_names()) 202 qmp_file = "." + next(tempfile._get_candidate_names())
203 qmp_param = ' -S -qmp unix:./%s,server,wait' % (qmp_file) 203 qmp_param = ' -S -qmp unix:./%s,server,wait' % (qmp_file)
204 qmp_port = self.tmpdir + "/" + qmp_file 204 qmp_port = self.tmpdir + "/" + qmp_file
205 # Create a second socket connection for debugging use, 205 # Create a second socket connection for debugging use,
206 # note this will NOT cause qemu to block waiting for the connection 206 # note this will NOT cause qemu to block waiting for the connection
207 qmp_file2 = "." + next(tempfile._get_candidate_names()) 207 qmp_file2 = "." + next(tempfile._get_candidate_names())
208 qmp_param += ' -qmp unix:./%s,server,nowait' % (qmp_file2) 208 qmp_param += ' -qmp unix:./%s,server,nowait' % (qmp_file2)
@@ -468,6 +468,8 @@ class QemuRunner:
468 socklist.remove(self.server_socket) 468 socklist.remove(self.server_socket)
469 self.logger.debug("Connection from %s:%s" % addr) 469 self.logger.debug("Connection from %s:%s" % addr)
470 else: 470 else:
471 # try to avoid reading only a single character at a time
472 time.sleep(0.1)
471 data = data + sock.recv(1024) 473 data = data + sock.recv(1024)
472 if data: 474 if data:
473 bootlog += data 475 bootlog += data