storage/lvm: update volume.size attribute on resize

When volume is resized, underlying LVM is adjusted if exists. For
persistent volumes it is enough, as generally the driver prefers
underlying LVM size than internal attribute. But volatile volume is
removed at vm shutdown, so that value is lost.

Fix it by updating Volume.size attribute too, to be updated in qubes.xml
later too.

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

View File

@ -665,6 +665,8 @@ class ThinVolume(qubes.storage.Volume):
elif self.save_on_stop or not self.snap_on_start:
cmd = ['extend', self._vid_current, str(size)]
yield from qubes_lvm_coro(cmd, self.log)
self._size = size
yield from reset_cache_coro()
@asyncio.coroutine