summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2018-07-25 16:34:33 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-26 13:16:41 +0100
commitc467bc856963d701e5a7d63f6e85e1361244489a (patch)
treeb59161da2629c6fedd7125fe1c30a8452fca9204 /meta/lib/oeqa
parent18225a16a4beb282add7d48770de13b2ca0412ec (diff)
downloadpoky-c467bc856963d701e5a7d63f6e85e1361244489a.tar.gz
qemurunner.py: fix is_alive() to avoid confusing with recycled pid
[YOCTO #12493] Fixed: - qemu started with pid 10000 - qemu exited unexpectedly - The pid 10000 is re-used by another different process. The is_alive() returned True in such a case because both qemu_pidfile and /proc/10000 exist, but it's another process, this patch fixed the problem. (From OE-Core rev: 78033af85698b4e112ae78e3140b241b1b3c06a3) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index c8bd6516cf..c3c643d710 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -400,7 +400,7 @@ class QemuRunner:
400 return False 400 return False
401 401
402 def is_alive(self): 402 def is_alive(self):
403 if not self.runqemu: 403 if not self.runqemu or self.runqemu.poll() is not None:
404 return False 404 return False
405 if os.path.isfile(self.qemu_pidfile): 405 if os.path.isfile(self.qemu_pidfile):
406 f = open(self.qemu_pidfile, 'r') 406 f = open(self.qemu_pidfile, 'r')