From 25e92bd19bc7f3b236a725716b16b08bd1c39608 Mon Sep 17 00:00:00 2001 From: Rusty Bird Date: Sat, 15 Jun 2019 16:03:45 +0000 Subject: [PATCH] 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. --- qubes/storage/reflink.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/qubes/storage/reflink.py b/qubes/storage/reflink.py index 8ad4857b..687f74ea 100644 --- a/qubes/storage/reflink.py +++ b/qubes/storage/reflink.py @@ -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