storage/reflink: volume.resize(): remove safety check

It is handled by 'qvm-volume resize', which has a '--force' option that
can't work if the check is duplicated in the storage driver.
This commit is contained in:
Rusty Bird 2019-06-15 16:03:45 +00:00
parent 30b92f8845
commit 25e92bd19b
No known key found for this signature in database
GPG Key ID: 469D78F47AAF2ADF

View File

@ -256,19 +256,13 @@ class ReflinkVolume(qubes.storage.Volume):
@_unblock
def resize(self, size):
''' Expand a read-write volume image; notify any corresponding
''' Resize a read-write volume image; notify any corresponding
loop devices of the size change.
'''
if not self.rw:
raise qubes.storage.StoragePoolException(
'Cannot resize: {} is read-only'.format(self.vid))
if size < self.size:
raise qubes.storage.StoragePoolException(
'For your own safety, shrinking of {} is disabled'
' ({} < {}). If you really know what you are doing,'
' use "truncate" manually.'.format(self.vid, size, self.size))
try: # assume volume is not (cleanly) stopped ...
_resize_file(self._path_dirty, size)
update = True