Skip to content
  • Iustin Pop's avatar
    htools: add parseUnit function · 1cb92fac
    Iustin Pop authored
    
    
    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: default avatarIustin Pop <iustin@google.com>
    Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
    1cb92fac