Skip to contentSkip to conversation

qemurunner.py: print output from runqemu/qemu-system in stop()

PATCH In review Alexander Kanavin 2 participants 2 messages Aug 26, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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().

---
 meta/lib/oeqa/utils/qemurunner.py | 2 ++
 1 file changed, 2 insertions(+)
meta/lib/oeqa/utils/qemurunner.py +2 -0
index 5c9d2b24a3..204ad8b918 100644
@@ -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
#1 lore raw
Quoted 17 lines · 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().

---
 meta/lib/oeqa/utils/qemurunner.py | 2 ++
 1 file changed, 2 insertions(+)
meta/lib/oeqa/utils/qemurunner.py +0 -0
index 5c9d2b24a3..204ad8b918 100644

meta/lib/oeqa/utils/qemurunner.py class QemuRunner: · line 542

Quoted 8 lines
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

This isn't quite so simple I'm afraid:

https://autobuilder.yoctoproject.org/typhoon/#/builders/97/builds/3210/steps/16/logs/stdio

Cheers,

Richard