summaryrefslogtreecommitdiffstats
path: root/scripts/runqemu
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-01 11:38:36 +0000
commit407138c7e59d1fe871cc563d57311e1223edd5c2 (patch)
tree362cf9ee7c77786cedf72f44f64cebea4919a008 /scripts/runqemu
parent2d0b794b03a391cd2d7873c0c35bcd360616dfc9 (diff)
downloadpoky-407138c7e59d1fe871cc563d57311e1223edd5c2.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) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/runqemu')
-rwxr-xr-xscripts/runqemu5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index d25de42f27..f661892aec 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -1220,7 +1220,10 @@ class BaseConfig(object):
1220 cmd = "%s %s" % (self.qemu_opt, kernel_opts) 1220 cmd = "%s %s" % (self.qemu_opt, kernel_opts)
1221 cmds = shlex.split(cmd) 1221 cmds = shlex.split(cmd)
1222 logger.info('Running %s\n' % cmd) 1222 logger.info('Running %s\n' % cmd)
1223 process = subprocess.Popen(cmds, stderr=subprocess.PIPE) 1223 pass_fds = []
1224 if self.lock_descriptor:
1225 pass_fds = [self.lock_descriptor.fileno()]
1226 process = subprocess.Popen(cmds, stderr=subprocess.PIPE, pass_fds=pass_fds)
1224 self.qemupid = process.pid 1227 self.qemupid = process.pid
1225 retcode = process.wait() 1228 retcode = process.wait()
1226 if retcode: 1229 if retcode: