neil / rpms / python-blivet

Forked from rpms/python-blivet a year ago
Clone
Blob Blame History Raw
From 2970b30815943edaa1575095cbf434fa9fc288a8 Mon Sep 17 00:00:00 2001
From: David Lehman <dlehman@redhat.com>
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