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:32 +0000
commitb9943e4bfe96e3e1242643014cba915924222fa4 (patch)
tree09f5b74cf5137228ed47d018ab609018e053e6a4 /scripts
parent7ad6069850af97a63397007069d146b0ff5cc14d (diff)
downloadpoky-b9943e4bfe96e3e1242643014cba915924222fa4.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: 1d03e0d54863124c5a65b59ecdc76dbac13d312a) 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 1eeafa9f5b..295c8b1b60 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -1218,7 +1218,10 @@ class BaseConfig(object):
1218 cmd = "%s %s" % (self.qemu_opt, kernel_opts) 1218 cmd = "%s %s" % (self.qemu_opt, kernel_opts)
1219 cmds = shlex.split(cmd) 1219 cmds = shlex.split(cmd)
1220 logger.info('Running %s\n' % cmd) 1220 logger.info('Running %s\n' % cmd)
1221 process = subprocess.Popen(cmds, stderr=subprocess.PIPE) 1221 pass_fds = []
1222 if self.lock_descriptor:
1223 pass_fds = [self.lock_descriptor.fileno()]
1224 process = subprocess.Popen(cmds, stderr=subprocess.PIPE, pass_fds=pass_fds)
1222 self.qemupid = process.pid 1225 self.qemupid = process.pid
1223 retcode = process.wait() 1226 retcode = process.wait()
1224 if retcode: 1227 if retcode: