[PATCH 5/6] Split out code to determine max unaligned partition size to a property.

David Lehman dlehman at redhat.com
Wed Oct 29 13:48:18 UTC 2014


On 10/29/2014 07:21 AM, Anne Mulhern wrote:
>
>
>
>
> ----- Original Message -----
>> From: "David Lehman" <dlehman at redhat.com>
>> To: anaconda-patches at lists.fedorahosted.org
>> Sent: Tuesday, October 28, 2014 3:20:02 PM
>> Subject: [PATCH 5/6] Split out code to determine max unaligned partition size	to a property.
>>
>> ---
>>   blivet/devices/partition.py | 10 ++++++++--
>>   1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/blivet/devices/partition.py b/blivet/devices/partition.py
>> index c6cfba8..d8e5de8 100644
>> --- a/blivet/devices/partition.py
>> +++ b/blivet/devices/partition.py
>> @@ -734,8 +734,8 @@ class PartitionDevice(StorageDevice):
>>       disk = property(lambda p: p._getDisk(), lambda p,d: p._setDisk(d))
>>
>>       @property
>> -    def maxSize(self):
>> -        """ The maximum size this partition can be. """
>> +    def _unalignedMaxPartSize(self):
>> +        """ Maximum size partition can grow to with unchanged start sector.
>> """
>
> Could add rtype here, as well.

Will do.

>
>>           # XXX Only allow growth up to the amount of free space following
>>           this
>>           #     partition on disk. We don't care about leading free space --
>>           #     a filesystem cannot be relocated, so if you want to use space
>> @@ -750,6 +750,12 @@ class PartitionDevice(StorageDevice):
>>               if partition.type == parted.PARTITION_FREESPACE:
>>                   maxPartSize = self.size +
>>                   Size(partition.getLength(unit="B"))
>>
>> +        return maxPartSize
>> +
>> +    @property
>> +    def maxSize(self):
>> +        """ The maximum size this partition can be. """
>> +        maxPartSize = self._unalignedMaxPartSize
>>           maxFormatSize = self.format.maxSize
>>           return min(maxFormatSize, maxPartSize) if maxFormatSize else
>>           maxPartSize
>>
>> --
>> 1.9.3
>>
>> _______________________________________________
>> anaconda-patches mailing list
>> anaconda-patches at lists.fedorahosted.org
>> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
>>
>
> - mulhern
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
>



More information about the anaconda-patches mailing list