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

Re: [PATCH 2/2] Clarify display of free space in storage tree view.



Ack.

David Lehman <dlehman redhat com> wrote:

> Show free regions within an extended partition as children of the
> extended. Also, use the grain size of the kernel-supplied alignment
> as the minimum size of free regions we display. We double that for
> free regions within an extended due to the great deal of variance
> in sizes of logical partition metadata areas allocated by parted.
>
> Resolves: rhbz#626025
> ---
>  iw/partition_gui.py |   17 ++++++++++++-----
>  1 files changed, 12 insertions(+), 5 deletions(-)
>
> diff --git a/iw/partition_gui.py b/iw/partition_gui.py
> index 95c6ef0..fe28581 100644
> --- a/iw/partition_gui.py
> +++ b/iw/partition_gui.py
> @@ -1044,10 +1044,17 @@ class PartitionWindow(InstallWindow):
>                          log.debug("can't find partition %s in device"
>                                             " tree" % partName)
>  
> -                    # ignore the tiny < 1 MB free space partitions (#119479)
> -                    if part.getSize(unit="MB") <= 1.0 and \
> -                       part.type & parted.PARTITION_FREESPACE:
> -                        if not part.active or not device.bootable:
> +                    # ignore any free space region that is less than the
> +                    # grain size of the disklabel alignment we are using
> +                    if part.type & parted.PARTITION_FREESPACE:
> +                        min_length = disk.format.alignment.grainSize
> +                        if part.type & parted.PARTITION_LOGICAL:
> +                            # ignored free regions in the extended can be up
> +                            # to twice the alignment grain size, to account
> +                            # for logical partition metadata
> +                            min_length *= 2
> +
> +                        if part.geometry.length < min_length:
>                              part = part.nextPartition()
>                              continue
>  
> @@ -1057,7 +1064,7 @@ class PartitionWindow(InstallWindow):
>                                                   "one extended partition per disk")
>                          extendedParent = self.tree.append(parent)
>                          iter = extendedParent
> -                    elif device and device.isLogical:
> +                    elif part.type & parted.PARTITION_LOGICAL:
>                          if not extendedParent:
>                              raise RuntimeError, ("crossed logical partition "
>                                                   "before extended")
> -- 
> 1.7.3.5
>
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list redhat com
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list

-- 
David Cantrell <dcantrell redhat com>
Supervisor, Installer Engineering Team
Red Hat, Inc. | Honolulu, HI | UTC-10


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