1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-20 06:50:22 +03:00

Check maximum startcpu value correctly

The cpus are indexed from 0, so a startcpu value equal
to the number of CPUs is invalid.

https://bugzilla.redhat.com/show_bug.cgi?id=1070680
This commit is contained in:
Ján Tomko 2014-04-03 19:38:54 +02:00
parent dd74ab4e82
commit 9fe5267ade

View File

@ -2928,10 +2928,10 @@ virCgroupGetPercpuStats(virCgroupPtr group,
goto cleanup;
}
if (start_cpu > total_cpus) {
if (start_cpu >= total_cpus) {
virReportError(VIR_ERR_INVALID_ARG,
_("start_cpu %d larger than maximum of %d"),
start_cpu, total_cpus);
start_cpu, total_cpus - 1);
goto cleanup;
}