From ff0790f45d9988a2aa4e5454ffff1b5e2c150dfe Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jul 21 2020 14:14:34 +0000 Subject: import python-blivet-3.1.0-21.el8_2 --- diff --git a/SOURCES/0030-Add-setters-for-requested_size-percent-form-LVMVolum.patch b/SOURCES/0030-Add-setters-for-requested_size-percent-form-LVMVolum.patch new file mode 100644 index 0000000..bf9731e --- /dev/null +++ b/SOURCES/0030-Add-setters-for-requested_size-percent-form-LVMVolum.patch @@ -0,0 +1,47 @@ +From 6d1863f3298fa7115b35e46ffd42ff56b5634256 Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Wed, 20 Nov 2019 11:19:36 +0100 +Subject: [PATCH 1/2] Add setters for requested_size/percent form + LVMVolumeGroupDevice + +Anaconda needs these to be able to set reserved size or percent +specified in kickstart. + +Resolves: rhbz#1737490 +--- + blivet/devices/lvm.py | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +diff --git a/blivet/devices/lvm.py b/blivet/devices/lvm.py +index dbecc1e5..3b33104d 100644 +--- a/blivet/devices/lvm.py ++++ b/blivet/devices/lvm.py +@@ -427,6 +427,25 @@ class LVMVolumeGroupDevice(ContainerDevice): + + return self.align(reserved, roundup=True) + ++ @reserved_space.setter ++ def reserved_space(self, value): ++ if self.exists: ++ raise ValueError("Can't set reserved space for an existing VG") ++ ++ self._reserved_space = value ++ ++ @property ++ def reserved_percent(self): ++ """ Reserved space in this VG in percent """ ++ return self._reserved_percent ++ ++ @reserved_percent.setter ++ def reserved_percent(self, value): ++ if self.exists: ++ raise ValueError("Can't set reserved percent for an existing VG") ++ ++ self._reserved_percent = value ++ + def _get_pv_usable_space(self, pv): + if isinstance(pv, MDRaidArrayDevice): + return self.align(pv.size - 2 * pv.format.pe_start) +-- +2.25.4 + diff --git a/SOURCES/0031-Allow-for-reserved-vg-space-and-a-growable-thin-pool.patch b/SOURCES/0031-Allow-for-reserved-vg-space-and-a-growable-thin-pool.patch new file mode 100644 index 0000000..db08213 --- /dev/null +++ b/SOURCES/0031-Allow-for-reserved-vg-space-and-a-growable-thin-pool.patch @@ -0,0 +1,33 @@ +From 2970b30815943edaa1575095cbf434fa9fc288a8 Mon Sep 17 00:00:00 2001 +From: David Lehman +Date: Wed, 11 Mar 2020 12:58:50 -0400 +Subject: [PATCH 2/2] Allow for reserved vg space and a growable thin pool. + (#1783946) + +--- + blivet/devices/lvm.py | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/blivet/devices/lvm.py b/blivet/devices/lvm.py +index 3b33104d..ed25fd1a 100644 +--- a/blivet/devices/lvm.py ++++ b/blivet/devices/lvm.py +@@ -417,10 +417,11 @@ class LVMVolumeGroupDevice(ContainerDevice): + reserved = self._reserved_percent * Decimal('0.01') * self.size + elif self._reserved_space > Size(0): + reserved = self._reserved_space +- elif self._thpool_reserve and any(lv.is_thin_pool for lv in self._lvs): +- reserved = min(max(self._thpool_reserve.percent * Decimal(0.01) * self.size, +- self._thpool_reserve.min), +- self._thpool_reserve.max) ++ ++ if self._thpool_reserve and any(lv.is_thin_pool for lv in self._lvs): ++ reserved += min(max(self._thpool_reserve.percent * Decimal(0.01) * self.size, ++ self._thpool_reserve.min), ++ self._thpool_reserve.max) + + # reserve space for the pmspare LV LVM creates behind our back + reserved += self.pmspare_size +-- +2.25.4 + diff --git a/SPECS/python-blivet.spec b/SPECS/python-blivet.spec index 86c22c3..14a54a1 100644 --- a/SPECS/python-blivet.spec +++ b/SPECS/python-blivet.spec @@ -23,7 +23,7 @@ Version: 3.1.0 #%%global prerelease .b2 # prerelease, if defined, should be something like .a1, .b1, .b2.dev1, or .c2 -Release: 20%{?prerelease}%{?dist} +Release: 21%{?prerelease}%{?dist} Epoch: 1 License: LGPLv2+ Group: System Environment/Libraries @@ -61,6 +61,8 @@ Patch26: 0026-Tell-lvm-to-ignore-skip-activation-flag-on-lvs-we-are-removing-or- Patch27: 0027-Align-base-partition-sizes-in-PartitionFactory.patch Patch28: 0028-Add-recognition-of-Dell-FW-RAID-to-udev-device_is_disk.patch Patch29: 0029-add-y-to-lvm.pvcreate.patch +Patch30: 0030-Add-setters-for-requested_size-percent-form-LVMVolum.patch +Patch31: 0031-Allow-for-reserved-vg-space-and-a-growable-thin-pool.patch # Versions of required components (done so we make sure the buildrequires # match the requires versions of things). @@ -223,6 +225,12 @@ configuration. %endif %changelog +* Wed Jun 10 2020 Vojtech Trefny - 3.1.0-21 +- Add setters for requested_size/percent form LVMVolumeGroupDevice + Related: rhbz#1841131 +- Allow for reserved vg space and a growable thin pool. + Resolves: rhbz#1841131 + * Mon Mar 02 2020 Vojtech Trefny - 3.1.0-20 - add `-y' to lvm.pvcreate Resolves: rhbz#1768494