qemurunner.py: print output from runqemu/qemu-system in stop()
PATCH 1/2 qemurunner.py: print output from runqemu/qemu-system in stop()
This is done when starting up qemu has failed, but is not done when qemu started ok, but fails later in QMP communication.
Output from runqemu does contain valuable information to find out why, so rather than fix all the QMP fails to include it, let's just print it in stop().
Signed-off-by Alexander Kanavin <[email protected]>
--- meta/lib/oeqa/utils/qemurunner.py | 2 ++ 1 file changed, 2 insertions(+)
meta/lib/oeqa/utils/qemurunner.py +2 -0
@@ -535,6 +535,8 @@ class QemuRunner: if self.runqemu.poll() is None: self.logger.debug("Sending SIGKILL to runqemu") os.killpg(os.getpgid(self.runqemu.pid), signal.SIGKILL) + if not self.runqemu.stdout.closed: + self.logger.info("Output from runqemu:\n%s" % self.getOutput(self.runqemu.stdout)) self.runqemu.stdin.close() self.runqemu.stdout.close() self.runqemu_exited = True
Signature · 1 line
2.31.1
PATCH 2/2 qemurunner.py: handle getOutput() having nothing to read
Signed-off-by Alexander Kanavin <[email protected]>
--- meta/lib/oeqa/utils/qemurunner.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
meta/lib/oeqa/utils/qemurunner.py +4 -1
@@ -123,7 +123,10 @@ class QemuRunner: import fcntl fl = fcntl.fcntl(o, fcntl.F_GETFL) fcntl.fcntl(o, fcntl.F_SETFL, fl | os.O_NONBLOCK) - return os.read(o.fileno(), 1000000).decode("utf-8") + try: + return os.read(o.fileno(), 1000000).decode("utf-8") + except BlockingIOError: + return "" def handleSIGCHLD(self, signum, frame):
Signature · 1 line
2.31.1