mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05: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:
1 parent
dd74ab4e82
commit
9fe5267ade
1 file changed
+2
-2
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user