mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Return error when --start <number> in cpu-stats is invalid.
Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
This commit is contained in:
parent
6306ee6249
commit
0ed35e0939
@ -7357,6 +7357,13 @@ cmdCPUStats(vshControl *ctl, const vshCmd *cmd)
|
|||||||
/* get number of cpus on the node */
|
/* get number of cpus on the node */
|
||||||
if ((max_id = virDomainGetCPUStats(dom, NULL, 0, 0, 0, 0)) < 0)
|
if ((max_id = virDomainGetCPUStats(dom, NULL, 0, 0, 0, 0)) < 0)
|
||||||
goto failed_stats;
|
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 < 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);
|
||||||
|
Loading…
Reference in New Issue
Block a user