]> xenbits.xensource.com Git - libvirt.git/commitdiff
virsh: fix memtune's help message for swap_hard_limit
authorNikunj A. Dadhania <nikunj@linux.vnet.ibm.com>
Wed, 16 Mar 2011 05:07:12 +0000 (10:37 +0530)
committerEric Blake <eblake@redhat.com>
Thu, 17 Mar 2011 22:45:06 +0000 (16:45 -0600)
* Correct the documentation for cgroup: the swap_hard_limit indicates
  mem+swap_hard_limit.
* Change cgroup private apis to: virCgroupGet/SetMemSwapHardLimit

Signed-off-by: Nikunj A. Dadhania <nikunj@linux.vnet.ibm.com>
docs/formatdomain.html.in
include/libvirt/libvirt.h.in
src/libvirt_private.syms
src/lxc/lxc_controller.c
src/lxc/lxc_driver.c
src/qemu/qemu_cgroup.c
src/qemu/qemu_driver.c
src/util/cgroup.c
src/util/cgroup.h

index f06b5249e241801c26258832f2960423a56b1b08..981cd6522f6c380a3fea5e949137a562da13fbd0 100644 (file)
         kilobytes (i.e. blocks of 1024 bytes)</dd>
       <dt><code>swap_hard_limit</code></dt>
       <dd> The optional <code>swap_hard_limit</code> element is the maximum
-        swap the guest can use. The units for this value are kilobytes
-        (i.e. blocks of 1024 bytes)</dd>
+        memory plus swap the guest can use. The units for this value are
+        kilobytes (i.e. blocks of 1024 bytes). This has to be more than
+        hard_limit value provided</dd>
       <dt><code>min_guarantee</code></dt>
       <dd> The optional <code>min_guarantee</code> element is the guaranteed
         minimum memory allocation for the guest. The units for this value are
index eaeccd6a82d8e09875330736d3bb7b0d0e1bf45a..fcca39d2f1257caedd287749d4ebfbe5df6793ca 100644 (file)
@@ -805,7 +805,8 @@ typedef enum {
  * VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT:
  *
  * Macro for the swap tunable swap_hard_limit: it represents the maximum swap
- * the guest can use.
+ * plus memory the guest can use. This limit has to be more than
+ * VIR_DOMAIN_MEMORY_HARD_LIMIT.
  */
 
 #define VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT "swap_hard_limit"
index c88d9346e0202075593d3c1ff1db352a35f176c3..55be36e7d8571c4cd9b9f4981e02a1359c2fde83 100644 (file)
@@ -74,10 +74,10 @@ virCgroupGetFreezerState;
 virCgroupGetMemoryHardLimit;
 virCgroupGetMemorySoftLimit;
 virCgroupGetMemoryUsage;
-virCgroupGetSwapHardLimit;
+virCgroupGetMemSwapHardLimit;
 virCgroupKill;
-virCgroupKillRecursive;
 virCgroupKillPainfully;
+virCgroupKillRecursive;
 virCgroupMounted;
 virCgroupPathOfController;
 virCgroupRemove;
@@ -87,7 +87,7 @@ virCgroupSetFreezerState;
 virCgroupSetMemory;
 virCgroupSetMemoryHardLimit;
 virCgroupSetMemorySoftLimit;
-virCgroupSetSwapHardLimit;
+virCgroupSetMemSwapHardLimit;
 
 
 # command.h
index eec05c7662c723d5de083d3c68c66f465769c478..1ab6351df27144ebf67d90fce9b7853050954f96 100644 (file)
@@ -146,7 +146,7 @@ static int lxcSetContainerResources(virDomainDefPtr def)
     }
 
     if (def->mem.swap_hard_limit) {
-        rc = virCgroupSetSwapHardLimit(cgroup, def->mem.swap_hard_limit);
+        rc = virCgroupSetMemSwapHardLimit(cgroup, def->mem.swap_hard_limit);
         if (rc != 0) {
             virReportSystemError(-rc,
                                  _("Unable to set swap hard limit for domain %s"),
index 79b687994e04d583ed65000a9e4aebe5951e660b..60d4204137066a0febfc5903aa9b07c92f0e2144 100644 (file)
@@ -779,7 +779,7 @@ static int lxcDomainSetMemoryParameters(virDomainPtr dom,
                 continue;
             }
 
-            rc = virCgroupSetSwapHardLimit(cgroup, params[i].value.ul);
+            rc = virCgroupSetMemSwapHardLimit(cgroup, params[i].value.ul);
             if (rc != 0) {
                 virReportSystemError(-rc, "%s",
                                      _("unable to set swap_hard_limit tunable"));
@@ -885,7 +885,7 @@ static int lxcDomainGetMemoryParameters(virDomainPtr dom,
             break;
 
         case 2: /* fill swap hard limit here */
-            rc = virCgroupGetSwapHardLimit(cgroup, &val);
+            rc = virCgroupGetMemSwapHardLimit(cgroup, &val);
             if (rc != 0) {
                 virReportSystemError(-rc, "%s",
                                      _("unable to get swap hard limit"));
index 8c3eee38de72d762ba38fcb291c185de834c1e92..935517fb7f2933af4c2add4bbb7f0325e54ef643 100644 (file)
@@ -330,7 +330,7 @@ int qemuSetupCgroup(struct qemud_driver *driver,
         }
 
         if (vm->def->mem.swap_hard_limit != 0) {
-            rc = virCgroupSetSwapHardLimit(cgroup, vm->def->mem.swap_hard_limit);
+            rc = virCgroupSetMemSwapHardLimit(cgroup, vm->def->mem.swap_hard_limit);
             if (rc != 0) {
                 virReportSystemError(-rc,
                                      _("Unable to set swap hard limit for domain %s"),
index dac2bf27f8dfad27a95c9aef060202bacfc56c1e..6055d8072bb5e6518ed51ea099ac4744cdf9f1ea 100644 (file)
@@ -4721,7 +4721,7 @@ static int qemuDomainSetMemoryParameters(virDomainPtr dom,
                 continue;
             }
 
-            rc = virCgroupSetSwapHardLimit(group, params[i].value.ul);
+            rc = virCgroupSetMemSwapHardLimit(group, params[i].value.ul);
             if (rc != 0) {
                 virReportSystemError(-rc, "%s",
                                      _("unable to set swap_hard_limit tunable"));
@@ -4832,7 +4832,7 @@ static int qemuDomainGetMemoryParameters(virDomainPtr dom,
             break;
 
         case 2: /* fill swap hard limit here */
-            rc = virCgroupGetSwapHardLimit(group, &val);
+            rc = virCgroupGetMemSwapHardLimit(group, &val);
             if (rc != 0) {
                 virReportSystemError(-rc, "%s",
                                      _("unable to get swap hard limit"));
index 9986e53a6c24613310d372cdf7c18845a6bbbac5..9a41a62dc35082d2cd834b6f2c2e58b27592877e 100644 (file)
@@ -1033,14 +1033,14 @@ int virCgroupGetMemorySoftLimit(virCgroupPtr group, unsigned long long *kb)
 }
 
 /**
- * virCgroupSetSwapHardLimit:
+ * virCgroupSetMemSwapHardLimit:
  *
- * @group: The cgroup to change swap hard limit for
- * @kb: The swap amount in kilobytes
+ * @group: The cgroup to change mem+swap hard limit for
+ * @kb: The mem+swap amount in kilobytes
  *
  * Returns: 0 on success
  */
-int virCgroupSetSwapHardLimit(virCgroupPtr group, unsigned long long kb)
+int virCgroupSetMemSwapHardLimit(virCgroupPtr group, unsigned long long kb)
 {
     unsigned long long maxkb = VIR_DOMAIN_MEMORY_PARAM_UNLIMITED;
 
@@ -1059,14 +1059,14 @@ int virCgroupSetSwapHardLimit(virCgroupPtr group, unsigned long long kb)
 }
 
 /**
- * virCgroupGetSwapHardLimit:
+ * virCgroupGetMemSwapHardLimit:
  *
- * @group: The cgroup to get swap hard limit for
- * @kb: The swap amount in kilobytes
+ * @group: The cgroup to get mem+swap hard limit for
+ * @kb: The mem+swap amount in kilobytes
  *
  * Returns: 0 on success
  */
-int virCgroupGetSwapHardLimit(virCgroupPtr group, unsigned long long *kb)
+int virCgroupGetMemSwapHardLimit(virCgroupPtr group, unsigned long long *kb)
 {
     long long unsigned int limit_in_bytes;
     int ret;
index 16ffb46f9e56530de1553971093db5b16867f29b..8ae756df28f68a0dbb6775b9e3222521b71ed398 100644 (file)
@@ -57,8 +57,8 @@ int virCgroupSetMemoryHardLimit(virCgroupPtr group, unsigned long long kb);
 int virCgroupGetMemoryHardLimit(virCgroupPtr group, unsigned long long *kb);
 int virCgroupSetMemorySoftLimit(virCgroupPtr group, unsigned long long kb);
 int virCgroupGetMemorySoftLimit(virCgroupPtr group, unsigned long long *kb);
-int virCgroupSetSwapHardLimit(virCgroupPtr group, unsigned long long kb);
-int virCgroupGetSwapHardLimit(virCgroupPtr group, unsigned long long *kb);
+int virCgroupSetMemSwapHardLimit(virCgroupPtr group, unsigned long long kb);
+int virCgroupGetMemSwapHardLimit(virCgroupPtr group, unsigned long long *kb);
 
 enum {
     VIR_CGROUP_DEVICE_READ  = 1,