[PATCH] virsh: Always print capacity unit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/virsh.c b/tools/virsh.c
index f5a01b3..d64e539 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -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";
-- 
1.8.1.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]