]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
src/util/vircgroupv2.c: interpret neg quota as "max"
authorantonios-f <anton.fadeev@red-soft.ru>
Thu, 17 Nov 2022 09:53:23 +0000 (09:53 +0000)
committerPavel Hrdina <phrdina@redhat.com>
Thu, 12 Jan 2023 12:11:41 +0000 (13:11 +0100)
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>
src/util/vircgroupv2.c

index 4c110940cf104a68898d67717192b246e5b4b29d..b1f562aa528fabaa37052ef525e05bdbca90f4e4 100644 (file)
@@ -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");