From d63d93b0abb6f0fa0b37fc3667a62372be011a0e Mon Sep 17 00:00:00 2001 From: Bahtiar `kalkin-` Gadimov Date: Sun, 4 Sep 2016 23:49:42 +0200 Subject: [PATCH] Fix file storage resize --- qubes/storage/__init__.py | 6 ++++++ qubes/storage/lvm.py | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/qubes/storage/__init__.py b/qubes/storage/__init__.py index e0257491..0ed1cb20 100644 --- a/qubes/storage/__init__.py +++ b/qubes/storage/__init__.py @@ -137,6 +137,12 @@ class Volume(object): def size(self): return self._size + @size.setter + def size(self, size): + # pylint: disable=attribute-defined-outside-init + self._size = int(size) + + @property def config(self): ''' return config data for serialization to qubes.xml ''' diff --git a/qubes/storage/lvm.py b/qubes/storage/lvm.py index be980865..3ccd2688 100644 --- a/qubes/storage/lvm.py +++ b/qubes/storage/lvm.py @@ -404,6 +404,12 @@ class ThinVolume(qubes.storage.Volume): except KeyError: return self._size + @size.setter + def size(self, _): + raise qubes.storage.StoragePoolException( + "You shouldn't use lvm size setter") + + @property def usage(self): # lvm thin usage always returns at least the same usage as # the parent