Forráskód Böngészése

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.
Rusty Bird 5 éve
szülő
commit
25e92bd19b
1 módosított fájl, 1 hozzáadás és 7 törlés
  1. 1 7
      qubes/storage/reflink.py

+ 1 - 7
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