]> xenbits.xensource.com Git - libvirt.git/commitdiff
virsh: fix cpu-stats command output format issue
authorLuyao Huang <lhuang@redhat.com>
Tue, 26 Jan 2016 02:25:05 +0000 (10:25 +0800)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 26 Jan 2016 08:23:49 +0000 (09:23 +0100)
After commit 57177f1, the cpu-stats command format change to:

CPU0:
    cpu_time         14401.507878990 seconds
    vcpu_time    14378732785511

vcpu_time is not user friendly. After this patch, it will
change back:
CPU0:
    cpu_time         14401.507878990 seconds
    vcpu_time        14378.732785511 seconds

https://bugzilla.redhat.com/show_bug.cgi?id=1301807

Signed-off-by: Luyao Huang <lhuang@redhat.com>
tools/virsh-domain.c

index 1089a4d89224dc959a24fdd41e4f109efeb3fa97..c2146d29c0cebb7ed0b2137e998c10db85811f3e 100644 (file)
@@ -7243,6 +7243,7 @@ vshCPUStatsPrintField(vshControl *ctl,
 {
     vshPrint(ctl, "\t%-12s ", param->field);
     if ((STREQ(param->field, VIR_DOMAIN_CPU_STATS_CPUTIME) ||
+         STREQ(param->field, VIR_DOMAIN_CPU_STATS_VCPUTIME) ||
          STREQ(param->field, VIR_DOMAIN_CPU_STATS_USERTIME) ||
          STREQ(param->field, VIR_DOMAIN_CPU_STATS_SYSTEMTIME)) &&
         param->type == VIR_TYPED_PARAM_ULLONG) {