[libvirt] [PATCH 3/3]cgroup: leave cgroup value checking to kernel

Chen Hanxiao chenhanxiao at cn.fujitsu.com
Fri Oct 11 13:41:24 UTC 2013


From: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>

Values for cgroup may change in the future kernels.
We should not hard-coded it.
Leave this job to kernel, who will take care of them.

Signed-off-by: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>
---
 src/util/vircgroup.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index a98bd63..b164dca 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -1797,13 +1797,6 @@ virCgroupPathOfController(virCgroupPtr group,
 int
 virCgroupSetBlkioWeight(virCgroupPtr group, unsigned int weight)
 {
-    if (weight > 1000 || weight < 100) {
-        virReportError(VIR_ERR_INVALID_ARG,
-                       _("weight '%u' must be in range (100, 1000)"),
-                       weight);
-        return -1;
-    }
-
     return virCgroupSetValueU64(group,
                                 VIR_CGROUP_CONTROLLER_BLKIO,
                                 "blkio.weight",
@@ -1855,13 +1848,6 @@ virCgroupSetBlkioDeviceWeight(virCgroupPtr group,
     struct stat sb;
     int ret;
 
-    if (weight && (weight > 1000 || weight < 100)) {
-        virReportError(VIR_ERR_INVALID_ARG,
-                       _("weight '%u' must be in range (100, 1000)"),
-                       weight);
-        return -1;
-    }
-
     if (stat(path, &sb) < 0) {
         virReportSystemError(errno,
                              _("Path '%s' is not accessible"),
-- 
1.8.2.1




More information about the libvir-list mailing list