public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in sys-cluster/vzctl/files: vzctl-3.0.22-adjust-meminfo.patch
@ 2008-11-08 19:41 Peter Volkov (pva)
  0 siblings, 0 replies; only message in thread
From: Peter Volkov (pva) @ 2008-11-08 19:41 UTC (permalink / raw
  To: gentoo-commits

pva         08/11/08 19:41:59

  Added:                vzctl-3.0.22-adjust-meminfo.patch
  Log:
  Patch to fix adjusting of memory limits without VE restart.
  (Portage version: 2.2_rc13/cvs/Linux 2.6.26-openvz.git-35f41f1 i686)

Revision  Changes    Path
1.1                  sys-cluster/vzctl/files/vzctl-3.0.22-adjust-meminfo.patch

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/vzctl/files/vzctl-3.0.22-adjust-meminfo.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/vzctl/files/vzctl-3.0.22-adjust-meminfo.patch?rev=1.1&content-type=text/plain

Index: vzctl-3.0.22-adjust-meminfo.patch
===================================================================
From: Igor Sukhih <igor@openvz.org>
Date: Thu, 30 Oct 2008 13:00:46 +0000 (+0300)
Subject: vzctl: adjust /proc/meminfo when privvmpages or --meminfo changes
X-Git-Tag: vzctl-3.0.23~1
X-Git-Url: http://git.openvz.org/?p=vzctl;a=commitdiff_plain;h=17705858ad37d34c2caa3f89d3af5bf2ad34073a;hp=372cd4f09f58a62a3dc05152ae288ad2b083a5b2

vzctl: adjust /proc/meminfo when privvmpages or --meminfo changes

Fixes http://bugzilla.openvz.org/623
---

diff --git a/src/lib/meminfo.c b/src/lib/meminfo.c
index 6c686ad..c4102c0 100644
--- a/src/lib/meminfo.c
+++ b/src/lib/meminfo.c
@@ -51,13 +51,20 @@ int vps_meminfo_set(vps_handler *h, envid_t veid, meminfo_param *gparam,
 		/* update meminfo on --privvmpages, --meminfo */
 		if (param->mode < 0 && privvmpages == NULL)
 			return 0;
-		if (gparam->mode < 0 && vps_p->g_param != NULL) {
-			param = &vps_p->g_param->res.meminfo;
-			if (param->mode != VE_MEMINFO_PRIVVMPAGES)
-				return 0;
+		if (vps_p->g_param != NULL) {
+			if (privvmpages == NULL)
+				/* use privvmpages from VE.conf on --meminfo */
+				privvmpages = vps_p->g_param->res.ub.privvmpages;
+
+			if (param->mode < 0) {
+				/* use meminfo from VE.conf on --privvmpages */
+				param = &vps_p->g_param->res.meminfo;
+				if (param->mode < 0)
+					param = &default_param;
+				if (param->mode != VE_MEMINFO_PRIVVMPAGES)
+					return 0;
+			}
 		}
-		if (privvmpages == NULL && vps_p->g_param != NULL)
-			privvmpages = vps_p->g_param->res.ub.privvmpages;
 	}
 	if (param->mode < 0)
 		param = &default_param;






^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2008-11-08 19:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-08 19:41 [gentoo-commits] gentoo-x86 commit in sys-cluster/vzctl/files: vzctl-3.0.22-adjust-meminfo.patch Peter Volkov (pva)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox