|
|
ff0790 |
From 6d1863f3298fa7115b35e46ffd42ff56b5634256 Mon Sep 17 00:00:00 2001
|
|
|
ff0790 |
From: Vojtech Trefny <vtrefny@redhat.com>
|
|
|
ff0790 |
Date: Wed, 20 Nov 2019 11:19:36 +0100
|
|
|
ff0790 |
Subject: [PATCH 1/2] Add setters for requested_size/percent form
|
|
|
ff0790 |
LVMVolumeGroupDevice
|
|
|
ff0790 |
|
|
|
ff0790 |
Anaconda needs these to be able to set reserved size or percent
|
|
|
ff0790 |
specified in kickstart.
|
|
|
ff0790 |
|
|
|
ff0790 |
Resolves: rhbz#1737490
|
|
|
ff0790 |
---
|
|
|
ff0790 |
blivet/devices/lvm.py | 19 +++++++++++++++++++
|
|
|
ff0790 |
1 file changed, 19 insertions(+)
|
|
|
ff0790 |
|
|
|
ff0790 |
diff --git a/blivet/devices/lvm.py b/blivet/devices/lvm.py
|
|
|
ff0790 |
index dbecc1e5..3b33104d 100644
|
|
|
ff0790 |
--- a/blivet/devices/lvm.py
|
|
|
ff0790 |
+++ b/blivet/devices/lvm.py
|
|
|
ff0790 |
@@ -427,6 +427,25 @@ class LVMVolumeGroupDevice(ContainerDevice):
|
|
|
ff0790 |
|
|
|
ff0790 |
return self.align(reserved, roundup=True)
|
|
|
ff0790 |
|
|
|
ff0790 |
+ @reserved_space.setter
|
|
|
ff0790 |
+ def reserved_space(self, value):
|
|
|
ff0790 |
+ if self.exists:
|
|
|
ff0790 |
+ raise ValueError("Can't set reserved space for an existing VG")
|
|
|
ff0790 |
+
|
|
|
ff0790 |
+ self._reserved_space = value
|
|
|
ff0790 |
+
|
|
|
ff0790 |
+ @property
|
|
|
ff0790 |
+ def reserved_percent(self):
|
|
|
ff0790 |
+ """ Reserved space in this VG in percent """
|
|
|
ff0790 |
+ return self._reserved_percent
|
|
|
ff0790 |
+
|
|
|
ff0790 |
+ @reserved_percent.setter
|
|
|
ff0790 |
+ def reserved_percent(self, value):
|
|
|
ff0790 |
+ if self.exists:
|
|
|
ff0790 |
+ raise ValueError("Can't set reserved percent for an existing VG")
|
|
|
ff0790 |
+
|
|
|
ff0790 |
+ self._reserved_percent = value
|
|
|
ff0790 |
+
|
|
|
ff0790 |
def _get_pv_usable_space(self, pv):
|
|
|
ff0790 |
if isinstance(pv, MDRaidArrayDevice):
|
|
|
ff0790 |
return self.align(pv.size - 2 * pv.format.pe_start)
|
|
|
ff0790 |
--
|
|
|
ff0790 |
2.25.4
|
|
|
ff0790 |
|