mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 13:09:50 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
18225a16a4
commit
c467bc8569
@@ -400,7 +400,7 @@ class QemuRunner:
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def is_alive(self):
|
def is_alive(self):
|
||||||
if not self.runqemu:
|
if not self.runqemu or self.runqemu.poll() is not None:
|
||||||
return False
|
return False
|
||||||
if os.path.isfile(self.qemu_pidfile):
|
if os.path.isfile(self.qemu_pidfile):
|
||||||
f = open(self.qemu_pidfile, 'r')
|
f = open(self.qemu_pidfile, 'r')
|
||||||
|
|||||||
Reference in New Issue
Block a user