[PATCH] Update getMaxLVSize from lvm1 to lvm2.

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

 



Maximum lv size in lvm2 does not depend on the extent size.

Resolves: rhbz#695299
---
 iw/lvm_dialog_gui.py    |    6 +++---
 lvm.py                  |   12 ++++++------
 textw/partition_text.py |    4 ++--
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/iw/lvm_dialog_gui.py b/iw/lvm_dialog_gui.py
index b10d7eb..7318e19 100644
--- a/iw/lvm_dialog_gui.py
+++ b/iw/lvm_dialog_gui.py
@@ -207,7 +207,7 @@ class VolumeGroupEditor:
             else:
                 self.updateLogVolStore()
 	else:
-	    maxlv = lvm.getMaxLVSize(curval)
+	    maxlv = lvm.getMaxLVSize()
 	    for lv in self.logvolreqs:
 		lvsize = lv.getActualSize(self.partitions, self.diskset,
                             pesize=lastval)
@@ -456,7 +456,7 @@ class VolumeGroupEditor:
         if not logrequest or not logrequest.getPreExisting():
             pesize = int(self.peCombo.get_active_value())
             (tspace, uspace, fspace) = self.computeSpaceValues(usepe=pesize)
-            maxlv = min(lvm.getMaxLVSize(pesize), fspace)
+            maxlv = min(lvm.getMaxLVSize(), fspace)
 
             # add in size of current logical volume if it has a size
             if logrequest and not isNew:
@@ -617,7 +617,7 @@ class VolumeGroupEditor:
 	    size = lvm.clampLVSizeRequest(size, pesize, roundup=1)
 
 	    # do some final tests
-	    maxlv = lvm.getMaxLVSize(pesize)
+	    maxlv = lvm.getMaxLVSize()
 	    if size > maxlv:
 		self.intf.messageWindow(_("Not enough space"),
 					_("The current requested size "
diff --git a/lvm.py b/lvm.py
index c0608ee..78b70fc 100644
--- a/lvm.py
+++ b/lvm.py
@@ -394,12 +394,12 @@ def clampPVSize(pvsize, pesize):
     pvsize *= 1024.0
     return long((math.floor(pvsize / pesize) * pesize) / 1024)
 
-def getMaxLVSize(pe):
-    """Given a PE size in KB, returns maximum size (in MB) of a logical volume.
-
-    pe - PE size in KB
-    """
-    return pe*64
+def getMaxLVSize():
+    """ Return the maximum size (in MB) of a logical volume. """
+    if iutil.getArch() in ("x86_64", "ppc64", "alpha", "ia64", "s390", "sparc"): #64bit architectures
+        return (8*1024*1024*1024*1024) #Max is 8EiB (very large number..)
+    else:
+        return (16*1024*1024) #Max is 16TiB
 
 def createSuggestedVGName(partitions):
     """Given list of partition requests, come up with a reasonable VG name
diff --git a/textw/partition_text.py b/textw/partition_text.py
index 5f2d1db..f8f06c9 100644
--- a/textw/partition_text.py
+++ b/textw/partition_text.py
@@ -1295,8 +1295,8 @@ class PartitionWindow:
                 pesize = vgreq.pesize
                 size = lvm.clampLVSizeRequest(size, pesize, roundup=1)
 
-                maxlv = lvm.getMaxLVSize(pesize)
-                if size > lvm.getMaxLVSize(pesize):
+                maxlv = lvm.getMaxLVSize()
+                if size > lvm.getMaxLVSize():
                     self.intf.messageWindow(_("Not enough space"),
                                             _("The current requested size "
                                               "(%10.2f MB) is larger than "
-- 
1.7.3.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux