summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-11-28 17:31:39 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-12-16 14:31:26 +0000
commit30148ab8742e39277e833300f26760d84e818a84 (patch)
tree2f65030f4e6369352fe62f68ed68fa6542910bc9 /scripts
parentd99e6afb8d6a7c3cfc8cf2eeab3db24dd9702d7f (diff)
downloadpoky-30148ab8742e39277e833300f26760d84e818a84.tar.gz
scripts/runqemu: Improve lockfile handling for python with close_fd=True
On python versions with close_fds=True (python 3.2 onwards), the tap device lockfile isn't passed to the child process. Since this guards against use of an active interface, we really want this here, so pass it in pass_fds. This means if the parent exits early, the child still holds the lock, avoiding messages like: runqemu - ERROR - Failed to run qemu: qemu-system-x86_64: could not configure /dev/net/tun (tap0): Device or resource busy (From OE-Core rev: 17a0a067d597c445c5892ff9914e91a2187f7e09) (From OE-Core rev: d3b3c55ddc312039380ce8e23e68dd8bb2439388) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/runqemu5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index a83c8a6944..c6b7580ddc 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -1215,7 +1215,10 @@ class BaseConfig(object):
1215 cmd = "%s %s" % (self.qemu_opt, kernel_opts) 1215 cmd = "%s %s" % (self.qemu_opt, kernel_opts)
1216 cmds = shlex.split(cmd) 1216 cmds = shlex.split(cmd)
1217 logger.info('Running %s\n' % cmd) 1217 logger.info('Running %s\n' % cmd)
1218 process = subprocess.Popen(cmds, stderr=subprocess.PIPE) 1218 pass_fds = []
1219 if self.lock_descriptor:
1220 pass_fds = [self.lock_descriptor.fileno()]
1221 process = subprocess.Popen(cmds, stderr=subprocess.PIPE, pass_fds=pass_fds)
1219 self.qemupid = process.pid 1222 self.qemupid = process.pid
1220 retcode = process.wait() 1223 retcode = process.wait()
1221 if retcode: 1224 if retcode: