render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
c480ed
From dd46b194155d91d44d8c10f5bca48a5b4d296f63 Mon Sep 17 00:00:00 2001
c480ed
Message-Id: <dd46b194155d91d44d8c10f5bca48a5b4d296f63@dist-git>
c480ed
From: Pavel Hrdina <phrdina@redhat.com>
c480ed
Date: Wed, 21 Aug 2019 09:42:35 +0200
c480ed
Subject: [PATCH] vircgroupv2: fix virCgroupV2GetCpuCfsQuota for "max" value
c480ed
c480ed
If the first value in cpu.max is "max" return from function.
c480ed
c480ed
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1741837
c480ed
c480ed
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
c480ed
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
c480ed
(cherry picked from commit 23689cddd4542041cdfa3416705993d373033961)
c480ed
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
c480ed
Message-Id: <287fbea9b44a5f7263505dc5fbd72d1bf2692bc6.1566373284.git.phrdina@redhat.com>
c480ed
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
c480ed
---
c480ed
 src/util/vircgroupv2.c | 4 +++-
c480ed
 1 file changed, 3 insertions(+), 1 deletion(-)
c480ed
c480ed
diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c
c480ed
index e129686a52..e31a2d1121 100644
c480ed
--- a/src/util/vircgroupv2.c
c480ed
+++ b/src/util/vircgroupv2.c
c480ed
@@ -1581,8 +1581,10 @@ virCgroupV2GetCpuCfsQuota(virCgroupPtr group,
c480ed
         return -1;
c480ed
     }
c480ed
 
c480ed
-    if (STREQLEN(str, "max", 3))
c480ed
+    if (STREQLEN(str, "max", 3)) {
c480ed
         *cfs_quota = ULLONG_MAX / 1000;
c480ed
+        return 0;
c480ed
+    }
c480ed
 
c480ed
     if (virStrToLong_ll(str, &str, 10, cfs_quota) < 0) {
c480ed
         virReportError(VIR_ERR_INTERNAL_ERROR,
c480ed
-- 
c480ed
2.23.0
c480ed