htools: add parseUnit function
This is similar, but not identical, to Utils.ParseUnit. The biggest difference is that we don't round up/down; as we only use integral types, the result will always be rounded down. Moreover, since (real-world) disk sizes come in SI units, the function differentiates between SI and binary prefixes, using lower-case for binary and upper-case for SI (similar to lvm usage). This distinction should be ported to the Python code. Signed-off-by:Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
Loading
Please register or sign in to comment