[PATCH 6/6] Convert everything to use Size.

David Lehman dlehman at redhat.com
Tue Jan 7 20:57:11 UTC 2014


On Sat, 2013-12-21 at 18:35 -0500, Anne Mulhern wrote:
> ----- Original Message -----
> > From: "Brian C. Lane" <bcl at redhat.com>
> > To: anaconda-patches at lists.fedorahosted.org
> > Sent: Friday, December 20, 2013 7:30:05 PM
> > Subject: Re: [PATCH 6/6] Convert everything to use Size.
> > 
> > On Fri, Dec 20, 2013 at 11:59:59AM -0600, David Lehman wrote:
> > > Size essentially stores sizes in bytes and provides methods for
> > > conversion between various units.
> > > 
> > > All sizes originating from within blivet are based on binary prefixes
> > > except where required to interface with other tools (see ntfsresize).
> > > ---
> > 
> > I really like how this looks. Makes things much more readable and should
> > eliminate all those pesky float rounding problems.
> > 
> > comments:
> > 
> > 1. There are several places where spec is used instead of en_spec for
> > constants.
> > 
> > 2. inconsistent use of spaces between the size and the units, I think
> > they are more readable with spaces.
> > 
> > 3. getPossiblePhysicalExtents dropped floor from the args. It is still
> > used in the function.
> > 
> > 4. In FileDevice._create buf is undefined and zero unused. Or we could
> > just use dd for this like we do in wipe.
> > 
> > That's all I spotted. Now I need a nap :)
> > 
> 
> I think that where self._size is set in StorageDevice constructor it should be made a Size
> or already be a Size.

It should already be a Size. Is there something in the patches to
indicate otherwise?

> 
> MD_CHUNK_SIZE is no longer used anywhere, it should be removed instead of changed.
> self.chunkSize is set in MDRaidArrayDevice, instead.

Fixed so that MDRaidArrayDevice uses mdraid.MD_CHUNK_SIZE instead of
making up the value on the spot.

> 
> In raid.py I defined this integer rounding up function, div_up. Maybe it would be
> better in Size, somewhere?

I like it where it is.

> 
> Probably all the raid methods that have to do with size should be reviewed...some of
> the mdraid tests are failing.

I've just re-checked them and fixed a bunch of things I broke with patch
6. New versions coming soon.

> 
> - mulhern
> 
> > --
> > Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA
> > (PST8PDT)
> > _______________________________________________
> > anaconda-patches mailing list
> > anaconda-patches at lists.fedorahosted.org
> > https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
> > 
> _______________________________________________
> 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