]> code.ossystems Code Review - openembedded-core.git/commitdiff
qemuimage-testlib-pythonhelper: Fix process mixups
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 5 Apr 2013 10:00:25 +0000 (10:00 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 5 Apr 2013 10:13:30 +0000 (11:13 +0100)
runqemu-internal runs "ldd qemu-system xxx" and the detection code was returning this
as the PID of qemu. This patch improves the detection code to avoid this problem,
fixing certain race type failures on the autobuilder.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/qemuimage-testlib-pythonhelper

index bb01246c77fbeb6030c996f7895d477c0233129a..4e6432b0fecd6acd51686f061ad81080cb277b48 100755 (executable)
@@ -3,6 +3,7 @@
 import optparse
 import subprocess
 import sys
+import os
 
 parser = optparse.OptionParser(
     usage = """
@@ -52,7 +53,10 @@ if options.findqemu:
         newparents = next
     #print "Children matching %s:" % str(parents)
     for p in parents:
-        if "qemu-system" in commands[p]:
+        # Need to be careful here since runqemu-internal runs "ldd qemu-system-xxxx"
+        basecmd = commands[p].split()[0]
+        basecmd = os.path.basename(basecmd)
+        if "qemu-system" in basecmd:
             print p
             sys.exit(0)
     sys.exit(1)