]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
cgroup: leave blkio cgroup value checking to kernel
authorChen Hanxiao <chenhanxiao@cn.fujitsu.com>
Fri, 11 Oct 2013 13:41:24 +0000 (21:41 +0800)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 15 Oct 2013 11:22:07 +0000 (12:22 +0100)
The range of valid values for cgroup tunables has
changed in the past and may change again in future
kernels. Avoid hardcoding range checks in libvirt
code, delegating range checking to the kernel itself.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
src/util/vircgroup.c

index 7a85000f639239671323fc7ed4112733eb264bfc..5c43e107ad9cb01e70fa4fedd0a962ea9875f015 100644 (file)
@@ -1796,13 +1796,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",
@@ -1854,13 +1847,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"),