]> xenbits.xensource.com Git - libvirt.git/commitdiff
LXC: LXC Blkio weight configuration support.
authorGui Jianfeng <guijianfeng@cn.fujitsu.com>
Tue, 8 Feb 2011 07:00:24 +0000 (15:00 +0800)
committerEric Blake <eblake@redhat.com>
Tue, 8 Feb 2011 18:43:54 +0000 (11:43 -0700)
LXC Blkio weight configuration support.

Reviewed-by: "Nikunj A. Dadhania" <nikunj@linux.vnet.ibm.com>
Signed-off-by: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
src/lxc/lxc_controller.c

index af0b70ceb788eb4497a94282b97e1d956c79f47d..0db667379a74d273827fab3fd8917f4d3c2f25c9 100644 (file)
@@ -104,6 +104,16 @@ static int lxcSetContainerResources(virDomainDefPtr def)
         goto cleanup;
     }
 
+    if (def->blkio.weight) {
+        rc = virCgroupSetBlkioWeight(cgroup, def->blkio.weight);
+        if (rc != 0) {
+            virReportSystemError(-rc,
+                                 _("Unable to set Blkio weight for domain %s"),
+                                 def->name);
+            goto cleanup;
+        }
+    }
+
     rc = virCgroupSetMemory(cgroup, def->mem.max_balloon);
     if (rc != 0) {
         virReportSystemError(-rc,