]> xenbits.xensource.com Git - libvirt.git/commitdiff
virsh: Always print capacity unit
authorJiri Denemark <jdenemar@redhat.com>
Thu, 14 Feb 2013 13:45:48 +0000 (14:45 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Tue, 19 Feb 2013 09:52:37 +0000 (10:52 +0100)
It doesn't make sense to print the unit (B) only with Ki, Mi, ...
prefixes. Even those poor bytes under 1 KiB are still bytes :-)

tools/virsh.c

index f5a01b3d5bfba6580f1961c38187a73f92bb1cab..d64e539660d4d951b7e938005fbe7505c6d4860f 100644 (file)
@@ -148,7 +148,7 @@ double
 vshPrettyCapacity(unsigned long long val, const char **unit)
 {
     if (val < 1024) {
-        *unit = "";
+        *unit = "B";
         return (double)val;
     } else if (val < (1024.0l * 1024.0l)) {
         *unit = "KiB";