[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH] Fix calculation of smallest PV's size in the lvm dialog. (#493753)



This was causing failures to set large(r) extent size with small(er) VGs.
---
 iw/lvm_dialog_gui.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/iw/lvm_dialog_gui.py b/iw/lvm_dialog_gui.py
index e07abf3..e325574 100644
--- a/iw/lvm_dialog_gui.py
+++ b/iw/lvm_dialog_gui.py
@@ -79,12 +79,12 @@ class VolumeGroupEditor:
         pvlist = self.getSelectedPhysicalVolumes()
 	for pv in pvlist:
             try:
-                pesize = int(self.peCombo.get_active_value())
+                pesize = int(self.peCombo.get_active_value()) / 1024.0
             except:
                 pesize = self.vg.peSize
 
             # FIXME: move this logic into a property of LVMVolumeGroupDevice
-            pvsize = lvm.clampSize(pv.size, pesize) - int(pesize/1024)
+            pvsize = max(0, lvm.clampSize(pv.size, pesize) - pesize)
 	    if first:
 		minpvsize = pvsize
 		first = 0
-- 
1.6.0.6


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]