aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Hernandez <alejandro.hernandez@linux.intel.com>2015-08-06 18:44:22 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-01 21:30:28 +0100
commit99ac0971aecb1b6bc113da28b79d169095e6b671 (patch)
tree5d831b18fa75dddabb1b0cea13d78f431d07a75f
parent144c6a2d711f7cf4dafc22999ed8cf4cdb329dfc (diff)
downloadopenembedded-core-99ac0971aecb1b6bc113da28b79d169095e6b671.zip
openembedded-core-99ac0971aecb1b6bc113da28b79d169095e6b671.tar.gz
openembedded-core-99ac0971aecb1b6bc113da28b79d169095e6b671.tar.bz2
qemurunner: Improves checking for server and target IPs on qemus parameters
Fixes OS hanging infinitely waiting for qemus process to release bitbake.lock (From OE-Core rev: d168bf34c553dbe5de7511e158cd83869d7a88bc) Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index f12e65d..16cf0e0 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -107,14 +107,17 @@ class QemuRunner:
cmdline = ''
with open('/proc/%s/cmdline' % self.qemupid) as p:
cmdline = p.read()
- ips = re.findall("((?:[0-9]{1,3}\.){3}[0-9]{1,3})", cmdline.split("ip=")[1])
- if not ips or len(ips) != 3:
+ try:
+ ips = re.findall("((?:[0-9]{1,3}\.){3}[0-9]{1,3})", cmdline.split("ip=")[1])
+ if not ips or len(ips) != 3:
+ raise ValueError
+ else:
+ self.ip = ips[0]
+ self.server_ip = ips[1]
+ except IndexError, ValueError:
logger.info("Couldn't get ip from qemu process arguments! Here is the qemu command line used: %s" % cmdline)
self.stop()
return False
- else:
- self.ip = ips[0]
- self.server_ip = ips[1]
logger.info("Target IP: %s" % self.ip)
logger.info("Server IP: %s" % self.server_ip)
logger.info("Waiting at most %d seconds for login banner" % self.boottime)