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 <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>
This commit is contained in:
Nitesh Konkar 2016-04-01 02:05:04 -04:00 committed by Ján Tomko
parent abf50874d6
commit d9a0a885e2

View File

@ -7360,7 +7360,7 @@ cmdCPUStats(vshControl *ctl, const vshCmd *cmd)
if (show_count < 0 || show_count > max_id) { if (show_count < 0 || show_count > max_id) {
if (show_count > max_id) if (show_count > max_id)
vshPrint(ctl, _("Only %d CPUs available to show\n"), 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 */ /* get percpu information */