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.
This commit is contained in:
Marek Marczykowski-Górecki 2017-10-08 18:37:25 +02:00
parent ede266ca3d
commit b8d45c214d
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -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():