From 9f5d05bfde04746e8d47972b306c924bad080c60 Mon Sep 17 00:00:00 2001 From: Rusty Bird Date: Sat, 15 Jun 2019 16:03:42 +0000 Subject: [PATCH] storage/reflink: update volume size in __init__() --- qubes/storage/reflink.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qubes/storage/reflink.py b/qubes/storage/reflink.py index 2fc4c03d..21ca8317 100644 --- a/qubes/storage/reflink.py +++ b/qubes/storage/reflink.py @@ -141,6 +141,13 @@ class ReflinkVolume(qubes.storage.Volume): self._path_import = self._path_vid + '-import.img' self.path = self._path_dirty + # In case the volume was previously resized, but then a crash + # prevented qubesd from serializing the new size to qubes.xml: + for path in (self._path_dirty, self._path_clean): + with suppress(FileNotFoundError): + self.size = os.path.getsize(path) + break + @_unblock def create(self): if self.save_on_stop and not self.snap_on_start: