[PATCH] virsh: Don't output node frequency if unknown

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

 



Commit ed8155eafbff5c5ca0bdfe84a8388f58b718c2f9 documented that
mhz field in virNodeInfo might be 0 if the frequency is unknown.  Modify
virsh to know about that.

Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx>
---
 tools/virsh-host.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/virsh-host.c b/tools/virsh-host.c
index 66f7fd9e62e4..7a223931b152 100644
--- a/tools/virsh-host.c
+++ b/tools/virsh-host.c
@@ -606,7 +606,8 @@ cmdNodeinfo(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
     }
     vshPrint(ctl, "%-20s %s\n", _("CPU model:"), info.model);
     vshPrint(ctl, "%-20s %d\n", _("CPU(s):"), info.cpus);
-    vshPrint(ctl, "%-20s %d MHz\n", _("CPU frequency:"), info.mhz);
+    if (info.mhz)
+        vshPrint(ctl, "%-20s %d MHz\n", _("CPU frequency:"), info.mhz);
     vshPrint(ctl, "%-20s %d\n", _("CPU socket(s):"), info.sockets);
     vshPrint(ctl, "%-20s %d\n", _("Core(s) per socket:"), info.cores);
     vshPrint(ctl, "%-20s %d\n", _("Thread(s) per core:"), info.threads);
-- 
2.4.5

--
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]