]> code.ossystems Code Review - openembedded-core.git/commit
runqemu: acquire_lock() should fail when failed to open the file
authorRobert Yang <liezhi.yang@windriver.com>
Mon, 19 Sep 2016 07:20:08 +0000 (00:20 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 19 Sep 2016 08:06:37 +0000 (09:06 +0100)
commitf364f773a0381a75b5992c8c8a1d63a81dbd4422
treed55be464259c4b72a72485c20ab7ecbfed2d709d
parent7c6d0e4ada6dea6ac994e637b7d5cf007f73e411
runqemu: acquire_lock() should fail when failed to open the file

The open(self.lock, 'w') may fail when the lock is created by other
users, return false for this case to let it try other devices.

Fixed:
runqemu - INFO - Running /sbin/ip link...
runqemu - INFO - Acquiring lockfile /tmp/qemu-tap-locks/tap0.lock...
Traceback (most recent call last):
  File "/buildarea/lyang1/poky/scripts/runqemu", line 972, in <module>
    ret = main()
  File "/buildarea/lyang1/poky/scripts/runqemu", line 963, in main
    config.setup_network()
  File "/buildarea/lyang1/poky/scripts/runqemu", line 810, in setup_network
    self.setup_tap()
  File "/buildarea/lyang1/poky/scripts/runqemu", line 761, in setup_tap
    if self.acquire_lock():
  File "/buildarea/lyang1/poky/scripts/runqemu", line 182, in acquire_lock
    lock_descriptor = open(self.lock, 'w')
PermissionError: [Errno 13] Permission denied: '/tmp/qemu-tap-locks/tap0.lock'

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/runqemu