summaryrefslogtreecommitdiffstats
path: root/partRequests.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2007-11-28 17:39:46 -0500
committerJeremy Katz <katzj@redhat.com>2007-11-29 16:12:01 -0500
commit349d9984e997529e88dcfb686580a6443f7e705a (patch)
treea2dfbbb7557973735a113cda364c5b15da6c820c /partRequests.py
parentbd5b1fa617aa81e6dd475b3513158b9a1f917a5e (diff)
downloadanaconda-349d9984e997529e88dcfb686580a6443f7e705a.tar.gz
anaconda-349d9984e997529e88dcfb686580a6443f7e705a.tar.xz
anaconda-349d9984e997529e88dcfb686580a6443f7e705a.zip
Add infrastructure for partition resizing
We add support to preexisting partitions to be resized by adjusting their partition spec and then acting on the changes within the main partitioning engine. Keep track of what the maximum size for a preexisting partitition is so that we don't have to check in the UI Filesystems can claim to be resizable and implement the resize() method as well as the getMinimumSize() method
Diffstat (limited to 'partRequests.py')
-rw-r--r--partRequests.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/partRequests.py b/partRequests.py
index e11327810..c5655e00f 100644
--- a/partRequests.py
+++ b/partRequests.py
@@ -155,6 +155,9 @@ class RequestSpec:
self.encryption = None
"""An optional LUKSDevice() describing block device encryption."""
+ self.targetSize = None
+ """Size to resize to"""
+
def __str__(self):
if self.fstype:
fsname = self.fstype.getName()
@@ -212,6 +215,9 @@ class RequestSpec:
if self.fslabel:
entry.setLabel(self.fslabel)
+ if self.targetSize and self.fstype.isResizable():
+ entry.setResizeTarget(self.targetSize, self.size)
+
return entry
def setProtected(self, val):
@@ -576,6 +582,18 @@ class PreexistingPartitionSpec(PartitionSpec):
mountpoint = mountpoint, preexist = 1)
self.type = REQUEST_PREEXIST
+ self.maxResizeSize = None
+ """Maximum size of this partition request"""
+
+ def getMaximumResizeMB(self):
+ if self.maxResizeSize is not None:
+ return self.maxResizeSize
+ log.warning("%s doesn't have a max size set" %(self.device,))
+ return MAX_PART_SIZE
+
+ def getMinimumResizeMB(self):
+ return self.fstype.getMinimumSize(self.device)
+
class RaidRequestSpec(RequestSpec):
"""Request to represent RAID devices."""