From: Juro Bystricky Date: Tue, 12 Sep 2017 19:23:27 +0000 (-0700) Subject: qemurunner.py: wait for PID to appear in procfs X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=bf05abc7931a9a9e0823b24c6f4df4f93913da82;p=openembedded-core.git qemurunner.py: wait for PID to appear in procfs We need QEMU PID in order to access "/proc//cmdline" Having a valid QEMU PID does not mean we can access the proc entry immediately, we need to wait for the /proc/ to appear before we can access it. (From OE-Core rev: d2d069fa9910d1c7a94c898355a63fca03ec5ad8) Signed-off-by: Juro Bystricky Signed-off-by: Richard Purdie Signed-off-by: Armin Kuster --- diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py index 59886b10ed..be50d5e771 100644 --- a/meta/lib/oeqa/utils/qemurunner.py +++ b/meta/lib/oeqa/utils/qemurunner.py @@ -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):