From: "Jan Beulich" Subject: [PATCH] qemu: bump RLIMIT_AS if restricted Date: Tue, 11 Jan 2011 10:18:39 +0000 Message-ID: <4D2C3C8F020000780002B92D@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part4864246F.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part4864246F.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Mostly the same as is already being done for several other RLIMIT_* values. Signed-off-by: Jan Beulich --- a/vl.c +++ b/vl.c @@ -4846,6 +4846,12 @@ int main(int argc, char **argv, char **e rl.rlim_cur =3D rl.rlim_max; if (setrlimit(RLIMIT_DATA, &rl) !=3D 0) perror("setrlimit(RLIMIT_DATA)"); + if (getrlimit(RLIMIT_AS, &rl) =3D=3D 0) { + rl.rlim_cur =3D rl.rlim_max; + if (setrlimit(RLIMIT_AS, &rl) !=3D 0) + perror("setrlimit(RLIMIT_AS)"); + } else + perror("getrlimit(RLIMIT_AS)"); rl.rlim_cur =3D RLIM_INFINITY; rl.rlim_max =3D RLIM_INFINITY; if (setrlimit(RLIMIT_RSS, &rl) !=3D 0) --=__Part4864246F.0__= Content-Type: text/plain; name="qemu-rlimit-as.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="qemu-rlimit-as.patch" Mostly the same as is already being done for several other RLIMIT_*=0Avalue= s.=0A=0ASigned-off-by: Jan Beulich =0A=0A--- = a/vl.c=0A+++ b/vl.c=0A@@ -4846,6 +4846,12 @@ int main(int argc, char = **argv, char **e=0A rl.rlim_cur =3D rl.rlim_max;=0A if (setrlimit(R= LIMIT_DATA, &rl) !=3D 0)=0A perror("setrlimit(RLIMIT_DATA)");=0A+ = if (getrlimit(RLIMIT_AS, &rl) =3D=3D 0) {=0A+ rl.rlim_cur =3D = rl.rlim_max;=0A+ if (setrlimit(RLIMIT_AS, &rl) !=3D 0)=0A+ = perror("setrlimit(RLIMIT_AS)");=0A+ } else=0A+ perror("getrlimit(R= LIMIT_AS)");=0A rl.rlim_cur =3D RLIM_INFINITY;=0A rl.rlim_max =3D = RLIM_INFINITY;=0A if (setrlimit(RLIMIT_RSS, &rl) !=3D 0)=0A --=__Part4864246F.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__Part4864246F.0__=--