targetcontrol: Improve logs by outputting qemu boot log in case of failure

We've had a few cases on the autobuilder where we've lost logs of
the boot and been unable to debug it further. Show this information
onto the console to be more useful.

(From OE-Core rev: 5302b7b8fa1349ae99040fe8fdcc4e42c722cc10)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie 2015-07-27 13:24:22 +00:00
parent edc7780ab7
commit e3aa7a30b3
1 changed files with 3 additions and 0 deletions

View File

@ -175,6 +175,9 @@ class QemuTarget(BaseTarget):
self.connection = SSHControl(ip=self.ip, logfile=self.sshlog)
else:
self.stop()
if os.path.exists(self.qemulog):
with open(self.qemulog, 'r') as f:
bb.error("Qemu log output from %s:\n%s" % (self.qemulog, f.read()))
raise bb.build.FuncFailed("%s - FAILED to start qemu - check the task log and the boot log" % self.pn)
def stop(self):