]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: Introduce virProcess{Get,Set}Limit()
authorAndrea Bolognani <abologna@redhat.com>
Tue, 23 Feb 2021 17:52:26 +0000 (18:52 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 8 Mar 2021 21:41:40 +0000 (22:41 +0100)
commit6a6d6bb5200c103cc6f4b0b08df5fb5679c7a765
tree6379fe4d0cc72b44907c648262781f956eef1aad
parent3d44a809c2ea2108e070bcfd5130071a0e4091d4
util: Introduce virProcess{Get,Set}Limit()

These functions abstract part of the existing logic, which is
the same in all virProcessSetMax*() functions, and changes it
so that which underlying syscall is used depends on their
availability rather than on the context in which they are
called: since prlimit() and {g,s}etrlimit() have slightly
different requirements, using the same one every single time
should make for a more consistent experience.

As part of the change, we also remove the special case for
passing zero to virProcessSetMax*() functions: we have removed
all callers that depended on that functionality in the previous
commit, so this is now safe to do and makes the semantics
simpler.

This commit is better viewed with 'git show -w'.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virprocess.c