]> 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>
Wed, 13 Sep 2017 20:59:57 +0000 (21:59 +0100)
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.

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

index 9073315fba06d4c94d93ef05f40e80dc5c2356b9..427ae23b1b7ec06f6f1895c655d7471a6caa188a 100644 (file)
@@ -394,9 +394,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):