From 9d5deffb13d03a223a1b8709f023e98dec3f9b37 Mon Sep 17 00:00:00 2001 From: Rusty Bird Date: Tue, 3 Dec 2019 18:21:51 +0000 Subject: [PATCH] storage/reflink: open in binary mode for loopdev resize ioctl The default (= text) mode for a loop device which contains a VM image looked weird, even though it didn't make a difference here because the dev_io object was never actually read from. --- qubes/storage/reflink.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qubes/storage/reflink.py b/qubes/storage/reflink.py index edf36ec3..1252fc69 100644 --- a/qubes/storage/reflink.py +++ b/qubes/storage/reflink.py @@ -439,7 +439,7 @@ def _update_loopdev_sizes(img): continue except FileNotFoundError: continue - with open('/dev/' + sys_path.split('/')[3]) as dev_io: + with open('/dev/' + sys_path.split('/')[3], 'rb') as dev_io: fcntl.ioctl(dev_io.fileno(), LOOP_SET_CAPACITY) def _attempt_ficlone(src, dst):