diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-08-29 17:04:38 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-08-30 11:14:26 +0100 |
commit | 06280ec2e329bbc7413dc162177d1da642608c05 (patch) | |
tree | a6262850b4afe187f4dfe1116badce2f82755899 /scripts | |
parent | b7bfbc18432c1e393a354c37ff970bfddb0e86cb (diff) | |
download | poky-06280ec2e329bbc7413dc162177d1da642608c05.tar.gz |
scripts/runqemu: Don't print error messages about tap file locks
Errors like:
runqemu - ERROR - Acquiring lockfile /tmp/qemu-tap-locks/tap0.lock failed: [Errno 11] Resource temporarily unavailable
are not really fatal errors. Change these to info messages instead
so people look later in the log for the real errors.
(From OE-Core rev: fac12de72bda1e864e71538be07d6c6f6e987498)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/runqemu | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/runqemu b/scripts/runqemu index 1131324ccc..df76270904 100755 --- a/scripts/runqemu +++ b/scripts/runqemu | |||
@@ -232,13 +232,17 @@ class BaseConfig(object): | |||
232 | self.mac_tap = "52:54:00:12:34:" | 232 | self.mac_tap = "52:54:00:12:34:" |
233 | self.mac_slirp = "52:54:00:12:35:" | 233 | self.mac_slirp = "52:54:00:12:35:" |
234 | 234 | ||
235 | def acquire_lock(self): | 235 | def acquire_lock(self, error=True): |
236 | logger.debug("Acquiring lockfile %s..." % self.lock) | 236 | logger.debug("Acquiring lockfile %s..." % self.lock) |
237 | try: | 237 | try: |
238 | self.lock_descriptor = open(self.lock, 'w') | 238 | self.lock_descriptor = open(self.lock, 'w') |
239 | fcntl.flock(self.lock_descriptor, fcntl.LOCK_EX|fcntl.LOCK_NB) | 239 | fcntl.flock(self.lock_descriptor, fcntl.LOCK_EX|fcntl.LOCK_NB) |
240 | except Exception as e: | 240 | except Exception as e: |
241 | logger.error("Acquiring lockfile %s failed: %s" % (self.lock, e)) | 241 | msg = "Acquiring lockfile %s failed: %s" % (self.lock, e) |
242 | if error: | ||
243 | logger.error(msg) | ||
244 | else: | ||
245 | logger.info(msg) | ||
242 | if self.lock_descriptor: | 246 | if self.lock_descriptor: |
243 | self.lock_descriptor.close() | 247 | self.lock_descriptor.close() |
244 | return False | 248 | return False |
@@ -927,7 +931,7 @@ class BaseConfig(object): | |||
927 | logger.info('Found %s.skip, skipping %s' % (lockfile, p)) | 931 | logger.info('Found %s.skip, skipping %s' % (lockfile, p)) |
928 | continue | 932 | continue |
929 | self.lock = lockfile + '.lock' | 933 | self.lock = lockfile + '.lock' |
930 | if self.acquire_lock(): | 934 | if self.acquire_lock(error=False): |
931 | tap = p | 935 | tap = p |
932 | logger.info("Using preconfigured tap device %s" % tap) | 936 | logger.info("Using preconfigured tap device %s" % tap) |
933 | logger.info("If this is not intended, touch %s.skip to make runqemu skip %s." %(lockfile, tap)) | 937 | logger.info("If this is not intended, touch %s.skip to make runqemu skip %s." %(lockfile, tap)) |