All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] qemurunner.py: print output from runqemu/qemu-system in stop()
@ 2021-08-26 13:00 Alexander Kanavin
  2021-08-26 13:00 ` [PATCH 2/2] qemurunner.py: handle getOutput() having nothing to read Alexander Kanavin
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Kanavin @ 2021-08-26 13:00 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alexander Kanavin

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 <alex.kanavin@gmail.com>
---
 meta/lib/oeqa/utils/qemurunner.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 5c9d2b24a3..204ad8b918 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -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
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] qemurunner.py: handle getOutput() having nothing to read
  2021-08-26 13:00 [PATCH 1/2] qemurunner.py: print output from runqemu/qemu-system in stop() Alexander Kanavin
@ 2021-08-26 13:00 ` Alexander Kanavin
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Kanavin @ 2021-08-26 13:00 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alexander Kanavin

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
 meta/lib/oeqa/utils/qemurunner.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 204ad8b918..d55248c497 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -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):
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-26 13:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-26 13:00 [PATCH 1/2] qemurunner.py: print output from runqemu/qemu-system in stop() Alexander Kanavin
2021-08-26 13:00 ` [PATCH 2/2] qemurunner.py: handle getOutput() having nothing to read Alexander Kanavin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.