提交 9fe5267a 编写于 作者: J Ján Tomko

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
上级 dd74ab4e
...@@ -2928,10 +2928,10 @@ virCgroupGetPercpuStats(virCgroupPtr group, ...@@ -2928,10 +2928,10 @@ virCgroupGetPercpuStats(virCgroupPtr group,
goto cleanup; goto cleanup;
} }
if (start_cpu > total_cpus) { if (start_cpu >= total_cpus) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("start_cpu %d larger than maximum of %d"), _("start_cpu %d larger than maximum of %d"),
start_cpu, total_cpus); start_cpu, total_cpus - 1);
goto cleanup; goto cleanup;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册