devices/loopback: add some info message

Show the file descriptor that was opened for the file passed to
the device. Recently, in CI, we have seen errors opening the
loop device with `fd` being `-1` and this ensures that at least
the file itself could be opened.
This commit is contained in:
Christian Kellner 2021-07-22 11:45:37 +00:00
parent 7f97f2c12e
commit b4c571ad87

View file

@ -99,6 +99,7 @@ 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)
except Exception as error: # pylint: disable: broad-except