]> code.ossystems Code Review - openembedded-core.git/commitdiff
qemurunner.py: fix is_alive() to avoid confusing with recycled pid
authorRobert Yang <liezhi.yang@windriver.com>
Wed, 25 Jul 2018 08:34:33 +0000 (16:34 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 26 Jul 2018 12:16:31 +0000 (13:16 +0100)
[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 <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/utils/qemurunner.py

index c8bd6516cf68301cad1c4c84a1077e2183248ebf..c3c643d71074ecb94a3c4ab36839b89aaef158e6 100644 (file)
@@ -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')