提交 0ed35e09 编写于 作者: N Nitesh Konkar 提交者: Andrea Bolognani

Return error when --start <number> in cpu-stats is invalid.

Signed-off-by: NNitesh Konkar <nitkon12@linux.vnet.ibm.com>
上级 6306ee62
......@@ -7357,6 +7357,13 @@ cmdCPUStats(vshControl *ctl, const vshCmd *cmd)
/* get number of cpus on the node */
if ((max_id = virDomainGetCPUStats(dom, NULL, 0, 0, 0, 0)) < 0)
goto failed_stats;
if (cpu >= max_id) {
vshError(ctl, "Start CPU %d is out of range (min: 0, max: %d)",
cpu, max_id - 1);
goto cleanup;
}
if (show_count < 0 || show_count > max_id) {
if (show_count > max_id)
vshPrint(ctl, _("Only %d CPUs available to show\n"), max_id);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册