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:
parent
30b92f8845
commit
25e92bd19b
@ -256,19 +256,13 @@ class ReflinkVolume(qubes.storage.Volume):
|
|||||||
|
|
||||||
@_unblock
|
@_unblock
|
||||||
def resize(self, size):
|
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.
|
loop devices of the size change.
|
||||||
'''
|
'''
|
||||||
if not self.rw:
|
if not self.rw:
|
||||||
raise qubes.storage.StoragePoolException(
|
raise qubes.storage.StoragePoolException(
|
||||||
'Cannot resize: {} is read-only'.format(self.vid))
|
'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 ...
|
try: # assume volume is not (cleanly) stopped ...
|
||||||
_resize_file(self._path_dirty, size)
|
_resize_file(self._path_dirty, size)
|
||||||
update = True
|
update = True
|
||||||
|
Loading…
Reference in New Issue
Block a user