]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
vircgroupv2: fix virCgroupV2GetCpuCfsQuota for "max" value
authorPavel Hrdina <phrdina@redhat.com>
Tue, 20 Aug 2019 11:59:54 +0000 (13:59 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Tue, 20 Aug 2019 15:37:37 +0000 (17:37 +0200)
If the first value in cpu.max is "max" return from function.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1741837

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
src/util/vircgroupv2.c

index 59ef2e63978a951748176240b06cdfd14ed74cbb..c62ee0d933acae412668b43b9e2bef6f221f79ae 100644 (file)
@@ -1582,8 +1582,10 @@ virCgroupV2GetCpuCfsQuota(virCgroupPtr group,
         return -1;
     }
 
-    if (STREQLEN(str, "max", 3))
+    if (STREQLEN(str, "max", 3)) {
         *cfs_quota = ULLONG_MAX / 1000;
+        return 0;
+    }
 
     if (virStrToLong_ll(str, &str, 10, cfs_quota) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,