]> code.ossystems Code Review - openembedded-core.git/commitdiff
qemurunner.py: wait for PID to appear in procfs
authorJuro Bystricky <juro.bystricky@intel.com>
Tue, 12 Sep 2017 19:23:27 +0000 (12:23 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 3 Mar 2018 08:32:13 +0000 (08:32 +0000)
We need QEMU PID in order to access "/proc/<qemupid>/cmdline"
Having a valid QEMU PID does not mean we can access the proc entry
immediately, we need to wait for the /proc/<qemupid> to appear
before we can access it.

(From OE-Core rev: d2d069fa9910d1c7a94c898355a63fca03ec5ad8)

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
meta/lib/oeqa/utils/qemurunner.py

index 59886b10ed5dd2f9a790b8cf0d8d64f3500029ff..be50d5e771879b0587d628cca077a62e9594e7d0 100644 (file)
@@ -393,9 +393,10 @@ class QemuRunner:
             f = open(self.qemu_pidfile, 'r')
             qemu_pid = f.read()
             f.close()
-            #logger.info("qemu_pid: %s" % qemu_pid)
-            self.qemupid = int(qemu_pid)
-            return True
+            qemupid = int(qemu_pid)
+            if os.path.exists("/proc/" + str(qemupid)):
+                self.qemupid = qemupid
+                return True
         return False
 
     def run_serial(self, command, raw=False, timeout=5):