Merge remote-tracking branch 'qubesos/pr/54' into core3-devel

* qubesos/pr/54:
  Fix file storage resize
  Fix lvm reset_cache size cache
This commit is contained in:
Marek Marczykowski-Górecki 2016-09-19 20:36:20 +02:00
commit 1af1784c69
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
2 changed files with 13 additions and 1 deletions

View File

@ -137,6 +137,12 @@ class Volume(object):
def size(self): def size(self):
return self._size return self._size
@size.setter
def size(self, size):
# pylint: disable=attribute-defined-outside-init
self._size = int(size)
@property @property
def config(self): def config(self):
''' return config data for serialization to qubes.xml ''' ''' return config data for serialization to qubes.xml '''

View File

@ -404,6 +404,12 @@ class ThinVolume(qubes.storage.Volume):
except KeyError: except KeyError:
return self._size return self._size
@size.setter
def size(self, _):
raise qubes.storage.StoragePoolException(
"You shouldn't use lvm size setter")
@property @property
def usage(self): # lvm thin usage always returns at least the same usage as def usage(self): # lvm thin usage always returns at least the same usage as
# the parent # the parent
@ -438,4 +444,4 @@ def qubes_lvm(cmd, log=logging.getLogger('qube.storage.lvm')):
def reset_cache(): def reset_cache():
qubes.storage.lvm.size_cache = init_cache qubes.storage.lvm.size_cache = init_cache()