From 108a44c557d94ba8eb999d30849adc13e660d875 Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Sun, 28 Jan 2024 09:21:46 +0100 Subject: [PATCH 1/2] Fix checking for segment type for cache pools The segtype is "cache-pool", not "cache_pool". --- blivet/devices/lvm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blivet/devices/lvm.py b/blivet/devices/lvm.py index 158f5569c..365261587 100644 --- a/blivet/devices/lvm.py +++ b/blivet/devices/lvm.py @@ -760,7 +760,7 @@ def __init__(self, name, parents=None, size=None, uuid=None, seg_type=None, # we reserve space for it self._metadata_size = self.vg.pe_size self._size -= self._metadata_size - elif self.seg_type in ("thin-pool", "cache_pool"): + elif self.seg_type in ("thin-pool", "cache-pool"): # LVMThinPoolMixin and LVMCachePoolMixin set self._metadata_size on their own if not self.exists and not from_lvs and not grow: # a thin pool we are not going to grow -> lets calculate metadata From 6238c91d5652e9b341c9a7d20e8c7c5ae7a3dce7 Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Mon, 29 Jan 2024 15:09:47 +0100 Subject: [PATCH 2/2] Fix getting default LVM cache metadata size from libblockdev Blivet expects all these sizes to be instance of blivet.size.Size and not an integer. --- blivet/devices/lvm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blivet/devices/lvm.py b/blivet/devices/lvm.py index 365261587..bb3cac0df 100644 --- a/blivet/devices/lvm.py +++ b/blivet/devices/lvm.py @@ -2311,7 +2311,7 @@ def autoset_md_size(self, enforced=False): old_md_size = self._metadata_size if self._metadata_size == 0 or enforced: - self._metadata_size = blockdev.lvm.cache_get_default_md_size(self._size) + self._metadata_size = Size(blockdev.lvm.cache_get_default_md_size(self._size)) log.debug("Using recommended metadata size: %s", self._metadata_size) self._metadata_size = self.vg.align(self._metadata_size, roundup=True)