Make _minInstanceSize, a source of minSize() value, always a Size.

This will make minSize be a Size more often and None less often, probably
never.

Remove class level variable _minInstanceSize in TmpFS. _minInstanceSize is
always set to Size(0) in FS.__init__(), and is supposed to be an instance
variable.

Signed-off-by: mulhern <amulhern@redhat.com>
Remove _minSize assignment to 0 where it's inherited from superclass.

Signed-off-by: mulhern <amulhern@redhat.com>
Update minSize method headers.

minSize values are no longer in megabytes and with filesystems the
minimum size may vary depending on the particular instance of the
filesystem.

Signed-off-by: mulhern <amulhern@redhat.com>
Put size values in Size universe eagerly.

Make everything that should be a Size a Size as soon as it is created,
for clarity, consistency, correctness.

* Clarity --- it's a way for the programmer to state, yes, I believe this is
a Size and I'm pretty confident about its units.
* Consistency --- a lot of methods say they return a Size, but many return a
Size or an int, depending on the path taken through the method. Better to
make these methods actually return a Size always.
* Correctness --- type correctness and logical correctness. The more we
ensure that we have the right type, the less likely we are to get an
AttributeError invoking convertTo() or humanReadable() on an int or a
Decimal. When we use Size we are required to specify the units, at least
implicitly, so we can better avoid intepreting a bare number as, for example,
1/1024th of its intended value.

Other changes in this patch:
* For the first argument of sum(), use a generator, not a list.
* Use // for division when a whole number is required, but generally cast
the result to an int anyway, to match expected Python type.
* Where a tuple made more sense than a list, and the code was being touched
anyway, change to a tuple.

This patch can not be guaranteed to be complete. These instance of values
that should be Sizes() were found by grepping and by instrumenting Size
to raise an error if it detected a computation with an incorrect type.
There are probably some more lurking.

Note: Currently blivet only has two types of units to compute with,
numbers (which could represent anything), and Sizes() which represent
numbers of bytes. This patch turns numbers into Sizes as much as possible.
At the present time, Size is implemented as a subclass of decimal.Decimal.
It overloads a few of the operations of Decimal, typically returning a Size
result. Sometimes this is the correct thing to do, and sometimes not.

For example, a number times a Size evaluates to a Size and a Size divided
by a number is a Size, which are both correct results with correct units.

However, it is wrong for a Size divided by a Size to evaluate to a Size;
as a ratio of two Sizes, the result should be a plain number.
It is wrong for the product of two Sizes to yield a Size, and almost certainly
a sign that there is a mistake, as most of our computations should not
result in products of Sizes. A Size + a plain number is a Size, which is
the typical way to let in errors where a plain number that represents MiBs
is added to a Size() yielding an incorrect Size result.

Eventually this problem should be fixed. In the meantime, however, the changes
I have made in this patch are intended to be compatible with a corrected
implementation of Size. The most sigificant instance is that sum() is
given a start value of Size(0), in case the list being summed over is empty.
The alternative, to convert the result of the sum operation to a Size,
is incompatible with a correct version of Size which would consider adding
a Size to a plain number to be an error.

Signed-off-by: mulhern <amulhern@redhat.com>
Add a method that determines whether a number is an exact power of 2.

Taking the log to determine whether a number is an exact power of 2 does
not always work, because log computes w/ floats, somehow. It usually works,
because base 2 works well w/ binary floating point representation.

Decimal does not actually have a log function. You can use change of base
to get log base 2, but you do not get an exact result.

Use method in is_valid_pool_chunk_size().

Signed-off-by: mulhern <amulhern@redhat.com>