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:
parent
dd74ab4e82
commit
9fe5267ade
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user