[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [PATCH][rhel6-branch] Align lv sizes when adding to vg total space used.
- From: David Cantrell <dcantrell redhat com>
- To: Discussion of Development and Customization of the Red Hat Linux Installer <anaconda-devel-list redhat com>
- Subject: Re: [PATCH][rhel6-branch] Align lv sizes when adding to vg total space used.
- Date: Mon, 07 Mar 2011 13:00:51 -1000
Ack once all the flags are set.
David Lehman <dlehman redhat com> wrote:
> This is for rhel6-branch and for master.
>
> Go back to using lv.vgSpaceUsed instead of lv.size, which will
> take into account striped lvs. Also, remove snapshots from
> vgSpaceUsed since they are tracked all together in vg.snapshotSpace.
>
> Resolves: rhbz#682156
> ---
> storage/devices.py | 6 ++++--
> 1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/storage/devices.py b/storage/devices.py
> index e6b7087..4b89901 100644
> --- a/storage/devices.py
> +++ b/storage/devices.py
> @@ -2164,7 +2164,7 @@ class LVMVolumeGroupDevice(DMDevice):
>
> # total the sizes of any LVs
> log.debug("%s size is %dMB" % (self.name, self.size))
> - used = sum(lv.size for lv in self.lvs) + self.snapshotSpace
> + used = sum(lv.vgSpaceUsed for lv in self.lvs) + self.snapshotSpace
> free = self.size - used
> log.debug("vg %s has %dMB free" % (self.name, free))
> return free
> @@ -2347,7 +2347,9 @@ class LVMLogicalVolumeDevice(DMDevice):
>
> @property
> def vgSpaceUsed(self):
> - return self.size * self.stripes + self.logSize + self.snapshotSpace
> + """ Space occupied by this LV, not including snapshots. """
> + return (self.vg.align(self.size, roundup=True) * self.stripes
> + + self.logSize)
>
> @property
> def vg(self):
> --
> 1.7.3.4
>
> _______________________________________________
> 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]