From: Nitesh Konkar Date: Fri, 1 Apr 2016 06:05:04 +0000 (-0400) Subject: Pass the correct cpu count when calling virDomainGetCPUStats. X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=d9a0a885e2b1cf3c9fc5260f9cdf4fc8a768f26c;p=libvirt.git Pass the correct cpu count when calling virDomainGetCPUStats. When using the --start option, the show_count should not be set to max_id as the --start 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 Signed-off-by: Ján Tomko --- diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index d0d2dd08d9..36d0353fdf 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -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 */