FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Development

 
 
LinkBack Thread Tools
 
Old 10-20-2011, 03:35 PM
David Lehman
 
Default Update getMaxLVSize from lvm1 to lvm2.

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@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 10-20-2011, 03:39 PM
David Lehman
 
Default Update getMaxLVSize from lvm1 to lvm2.

This patch is broken. I forgot that iutil.getArch didn't exist in
rhel5-branch. I'll send a new version when it's sorted out.

On Thu, 2011-10-20 at 10:35 -0500, David Lehman wrote:
> 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 "


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 10-24-2011, 09:52 PM
David Lehman
 
Default Update getMaxLVSize from lvm1 to lvm2.

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

Also, if you're checking limits on new pe size, clamp lvs using
the new pe size, not the old one.

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

diff --git a/iw/lvm_dialog_gui.py b/iw/lvm_dialog_gui.py
index b10d7eb..f0aa367 100644
--- a/iw/lvm_dialog_gui.py
+++ b/iw/lvm_dialog_gui.py
@@ -207,10 +207,10 @@ 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)
+ pesize=curval)
if lvsize > maxlv:
self.intf.messageWindow(_("Not enough space"),
_("The physical extent size "
@@ -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..64f6afe 100644
--- a/lvm.py
+++ b/lvm.py
@@ -16,6 +16,7 @@ import os,sys
import string
import math
import isys
+import rhpl.arch

from flags import flags

@@ -394,12 +395,13 @@ 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 rhpl.arch.canonArch in ("s390x", "sparc64", "x86_64", "ia64") or
+ rhpl.arch.canonArch.startswith("ppc64"): #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@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 10-25-2011, 01:26 PM
David Cantrell
 
Default Update getMaxLVSize from lvm1 to lvm2.

Looks good.

On 10/24/2011 05:52 PM, David Lehman wrote:

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

Also, if you're checking limits on new pe size, clamp lvs using
the new pe size, not the old one.

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

diff --git a/iw/lvm_dialog_gui.py b/iw/lvm_dialog_gui.py
index b10d7eb..f0aa367 100644
--- a/iw/lvm_dialog_gui.py
+++ b/iw/lvm_dialog_gui.py
@@ -207,10 +207,10 @@ 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)
+ pesize=curval)
if lvsize> maxlv:
self.intf.messageWindow(_("Not enough space"),
_("The physical extent size "
@@ -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..64f6afe 100644
--- a/lvm.py
+++ b/lvm.py
@@ -16,6 +16,7 @@ import os,sys
import string
import math
import isys
+import rhpl.arch

from flags import flags

@@ -394,12 +395,13 @@ 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 rhpl.arch.canonArch in ("s390x", "sparc64", "x86_64", "ia64") or
+ rhpl.arch.canonArch.startswith("ppc64"): #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 "




--
David Cantrell <dcantrell@redhat.com>
Supervisor, Installer Engineering Team
Red Hat, Inc. | Westford, MA | EST5EDT

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

Thread Tools




All times are GMT. The time now is 04:23 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org