storage/lvm: don't try to resize non-existing lvm volumes

Volume with save_on_stop=False and snap_on_start=False exists only when
VM is running and this is already handled under is_dirty() condition.
For non-running VMs, skip LVM resize step and only update internal size
attribute.

Fixes QubesOS/qubes-issues#5645
This commit is contained in:
Marek Marczykowski-Górecki 2020-02-12 21:57:34 +01:00
parent 6b474e39f6
commit 86881afeef
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -662,7 +662,7 @@ class ThinVolume(qubes.storage.Volume):
os.path.exists('/dev/' + self._vid_import):
cmd = ['extend', self._vid_import, str(size)]
yield from qubes_lvm_coro(cmd, self.log)
elif self.save_on_stop or not self.snap_on_start:
elif self.save_on_stop and not self.snap_on_start:
cmd = ['extend', self._vid_current, str(size)]
yield from qubes_lvm_coro(cmd, self.log)