]> xenbits.xensource.com Git - libvirt.git/commitdiff
Pass the correct cpu count when calling virDomainGetCPUStats.
authorNitesh Konkar <niteshkonkar.libvirt@gmail.com>
Fri, 1 Apr 2016 06:05:04 +0000 (02:05 -0400)
committerJán Tomko <jtomko@redhat.com>
Fri, 1 Apr 2016 09:36:04 +0000 (11:36 +0200)
When using the --start option, the show_count should not be set to
max_id as the --start <cpu> means we dont need those many initial cpu
stats. Hence, show_count should be adjusted accordingly.

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

Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
tools/virsh-domain.c

index d0d2dd08d973e5ce040a9d9b57bcc8cd66ef3758..36d0353fdfbd865d28f3ef73704d18c64976a72c 100644 (file)
@@ -7360,7 +7360,7 @@ cmdCPUStats(vshControl *ctl, const vshCmd *cmd)
     if (show_count < 0 || show_count > max_id) {
         if (show_count > max_id)
             vshPrint(ctl, _("Only %d CPUs available to show\n"), max_id);
-        show_count = max_id;
+        show_count = max_id - cpu;
     }
 
     /* get percpu information */