Browse Source

storage/lvm: don't crash when resizing to the same size

This applies to qvm-template-postprocess, which at the beginning try to
resize root volume to appropriate size. It makes more sense to silently
succeed here, instead of forcing every client-side utility to check if
the volume have already desired size.
Marek Marczykowski-Górecki 7 years ago
parent
commit
b8d45c214d
1 changed files with 3 additions and 0 deletions
  1. 3 0
      qubes/storage/lvm.py

+ 3 - 0
qubes/storage/lvm.py

@@ -395,6 +395,9 @@ class ThinVolume(qubes.storage.Volume):
                 ' are doing, use `lvresize` on %s manually.' %
                 (self.name, self.vid))
 
+        if size == self.size:
+            return
+
         cmd = ['extend', self.vid, str(size)]
         qubes_lvm(cmd, self.log)
         if self.is_dirty():