]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: new virCommandSetMax(MemLock|Processes|Files)
authorLaine Stump <laine@laine.org>
Thu, 25 Apr 2013 16:10:10 +0000 (12:10 -0400)
committerLaine Stump <laine@laine.org>
Fri, 26 Apr 2013 14:23:46 +0000 (10:23 -0400)
commit776d49f492ed6e19f367291f2e552c30fad0571e
tree378becdeb571acff877ab818795c9af6b3fedcdd
parentf3662737b1bd6451597b9fc11d8f52be87b15871
util: new virCommandSetMax(MemLock|Processes|Files)

This patch adds two sets of functions:

1) lower level virProcessSet*() functions that will immediately set
the RLIMIT_MEMLOCK. RLIMIT_NPROC, or RLIMIT_NOFILE of either the
current process (using setrlimit()) or any other process (using
prlimit()). "current process" is indicated by passing a 0 for pid.

2) functions for virCommand* that will setup a virCommand object to
set those limits at a later time just after it has forked a new
process, but before it execs the new program.

configure.ac has prlimit and setrlimit added to the list of functions
to check for, and the low level functions log an "unsupported" error)
on platforms that don't support those functions.
configure.ac
src/libvirt_private.syms
src/util/vircommand.c
src/util/vircommand.h
src/util/virprocess.c
src/util/virprocess.h