From: antonios-f Date: Thu, 17 Nov 2022 09:53:23 +0000 (+0000) Subject: src/util/vircgroupv2.c: interpret neg quota as "max" X-Git-Tag: v9.0.0-rc2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9233f0fa8c8e031197c647f7bc980dee45283641;p=thirdparty%2Flibvirt.git 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 Reviewed-by: Pavel Hrdina --- diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index 4c110940cf..b1f562aa52 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@ -1611,7 +1611,7 @@ virCgroupV2SetCpuCfsQuota(virCgroup *group, return -1; } - if (cfs_quota == VIR_CGROUP_CPU_QUOTA_MAX) { + if (cfs_quota < 0 || cfs_quota == VIR_CGROUP_CPU_QUOTA_MAX) { return virCgroupSetValueStr(group, VIR_CGROUP_CONTROLLER_CPU, "cpu.max", "max");