devices/loopback: better log message
It is more interesting which loopback device was used by which host service instead of the file descriptor. Log that instead.
This commit is contained in:
parent
b26d33910a
commit
f280cfff18
1 changed files with 2 additions and 1 deletions
|
|
@ -88,13 +88,14 @@ class LoopbackService(devices.DeviceService):
|
|||
path = os.path.join(tree, filename.lstrip("/"))
|
||||
|
||||
self.fd = os.open(path, os.O_RDWR | os.O_CLOEXEC)
|
||||
print(f"file '{filename}' opened as {self.fd}")
|
||||
try:
|
||||
self.lo = self.make_loop(self.fd, start, size, lock)
|
||||
except Exception as error: # pylint: disable: broad-except
|
||||
self.close()
|
||||
raise error from None
|
||||
|
||||
print(f"{self.lo.devname} acquired (locked: {lock})")
|
||||
|
||||
dir_fd = -1
|
||||
try:
|
||||
dir_fd = os.open(devpath, os.O_CLOEXEC | os.O_PATH)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue