From: Robert Yang Date: Wed, 25 Jul 2018 08:34:33 +0000 (+0800) Subject: qemurunner.py: fix is_alive() to avoid confusing with recycled pid X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~17220 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78033af85698b4e112ae78e3140b241b1b3c06a3;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git 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. Signed-off-by: Robert Yang Signed-off-by: Richard Purdie --- diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py index c8bd6516cf6..c3c643d7107 100644 --- a/meta/lib/oeqa/utils/qemurunner.py +++ b/meta/lib/oeqa/utils/qemurunner.py @@ -400,7 +400,7 @@ class QemuRunner: return False def is_alive(self): - if not self.runqemu: + if not self.runqemu or self.runqemu.poll() is not None: return False if os.path.isfile(self.qemu_pidfile): f = open(self.qemu_pidfile, 'r')