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
джерело c332de9653
коміт 6b474e39f6
Не вдалося знайти GPG ключ що відповідає даному підпису
Ідентифікатор GPG ключа: 063938BA42CFA724

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