Lines Matching refs:lockfile
253 lockfile = os.path.join(lockdir, str(port) + '.lock')
254 if self.acquire_portlock(lockfile):
258 self.release_portlock(lockfile)
266 def acquire_portlock(self, lockfile): argument
267 logger.debug("Acquiring lockfile %s..." % lockfile)
269 portlock_descriptor = open(lockfile, 'w')
270 self.portlocks.update({lockfile: portlock_descriptor})
271 fcntl.flock(self.portlocks[lockfile], fcntl.LOCK_EX|fcntl.LOCK_NB)
273 msg = "Acquiring lockfile %s failed: %s" % (lockfile, e)
275 if lockfile in self.portlocks.keys() and self.portlocks[lockfile]:
276 self.portlocks[lockfile].close()
277 del self.portlocks[lockfile]
281 def release_portlock(self, lockfile=None): argument
282 if lockfile != None:
283 logger.debug("Releasing lockfile '%s'" % lockfile)
287 self.portlocks[lockfile].close()
290 del self.portlocks[lockfile]
292 for lockfile, descriptor in self.portlocks.items():
293 logger.debug("Releasing lockfile '%s'" % lockfile)
1146 lockfile = os.path.join(lockdir, p)
1147 if os.path.exists('%s.skip' % lockfile):
1148 logger.info('Found %s.skip, skipping %s' % (lockfile, p))
1150 self.taplock = lockfile + '.lock'
1154 … logger.info("If this is not intended, touch %s.skip to make runqemu skip %s." %(lockfile, tap))
1172 lockfile = os.path.join(lockdir, tap)
1173 self.taplock = lockfile + '.lock'