storage/lvm: check for LVM LV existence and type when creating ThinPool

Check if requested thin pool exists and really is thin pool.

QubesOS/qubes-issues#3438
Šī revīzija ir iekļauta:
Marek Marczykowski-Górecki 2018-01-12 05:12:08 +01:00
vecāks 377f331d52
revīzija bcf42c13fa
Šim parakstam datu bāzē netika atrasta zināma atslēga
GPG atslēgas ID: 063938BA42CFA724

Parādīt failu

@ -98,6 +98,13 @@ class ThinPool(qubes.storage.Pool):
def setup(self):
reset_cache()
cache_key = self.volume_group + '/' + self.thin_pool
if cache_key not in size_cache:
raise qubes.storage.StoragePoolException(
'Thin pool {} does not exist'.format(cache_key))
if size_cache[cache_key]['attr'][0] != 't':
raise qubes.storage.StoragePoolException(
'Volume {} is not a thin pool'.format(cache_key))
# TODO Should we create a non existing pool?
def get_volume(self, vid):