]> xenbits.xensource.com Git - libvirt.git/commitdiff
virsh: Don't output node frequency if unknown
authorMartin Kletzander <mkletzan@redhat.com>
Fri, 10 Jul 2015 09:05:07 +0000 (11:05 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Thu, 16 Jul 2015 09:56:15 +0000 (11:56 +0200)
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@redhat.com>
tools/virsh-host.c
tools/virsh.pod

index 04ca1e5047316c2e91c0b34a8b059dd063b002d5..a3ffe0143f1138dfd4151a49952e0feadee6918d 100644 (file)
@@ -637,7 +637,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);
index bcfa165ada15c0db207c64a80ea2eff7b4077b49..5ee9a966ef023a193f6c95ffdb3c8449d6f334da 100644 (file)
@@ -295,7 +295,8 @@ Print the XML representation of the hypervisor sysinfo, if available.
 Returns basic information about the node, like number and type of CPU,
 and size of the physical memory. The output corresponds to virNodeInfo
 structure. Specifically, the "CPU socket(s)" field means number of CPU
-sockets per NUMA cell.
+sockets per NUMA cell. The information libvirt displays is dependent
+upon what each architecture may provide.
 
 =item B<nodecpumap> [I<--pretty>]