mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-24 05:25:18 +00:00
src/util/vircgroupv2.c: interpret neg quota as "max"
Because of kernel doesn't allow passing negative values to cpu.max as quota, it's needing to convert negative values to "max" token. Signed-off-by: Anton Fadeev <anton.fadeev@red-soft.ru> Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
f41d1a2e75
commit
9233f0fa8c
@ -1611,7 +1611,7 @@ virCgroupV2SetCpuCfsQuota(virCgroup *group,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cfs_quota == VIR_CGROUP_CPU_QUOTA_MAX) {
|
if (cfs_quota < 0 || cfs_quota == VIR_CGROUP_CPU_QUOTA_MAX) {
|
||||||
return virCgroupSetValueStr(group,
|
return virCgroupSetValueStr(group,
|
||||||
VIR_CGROUP_CONTROLLER_CPU,
|
VIR_CGROUP_CONTROLLER_CPU,
|
||||||
"cpu.max", "max");
|
"cpu.max", "max");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user