]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Don't set cur=inf RLIM_NOFILE on macOS
authorLaura Hild <lsh@jlab.org>
Tue, 15 Aug 2023 14:54:20 +0000 (10:54 -0400)
committerDaniel P. Berrangé <berrange@redhat.com>
Wed, 30 Aug 2023 07:34:00 +0000 (08:34 +0100)
commitc4d96fdd3cbcb3ecdc23fbf04f88579259fcafa3
tree1c92b25c34c3f5def695225ca8a67c38a71cdd6c
parent120724bc6d1c2f8c029e67bd91335b48c243404c
Don't set cur=inf RLIM_NOFILE on macOS

virProcessActivateMaxFiles sets rlim_cur to rlim_max.
If rlim_max is RLIM_INFINITY,

2023-08-15 15:17:51.944+0000: 4456752640: debug :
virProcessActivateMaxFiles:1067 : Initial max files was 2560
2023-08-15 15:17:51.944+0000: 4456752640: debug :
virProcessActivateMaxFiles:1077 : Raised max files to
9223372036854775807

then when virCommandMassClose does `int openmax = sysconf(
_SC_OPEN_MAX)`, `openmax < 0` is true and virCommandMassClose
reports an error and bails.  Setting rlim_cur instead to at most
OPEN_MAX, as macOS' documentation suggests, both avoids this problem

2023-08-18 16:01:44.366+0000: 4359562752: debug :
virProcessActivateMaxFiles:1072 : Initial max files was 256
2023-08-18 16:01:44.366+0000: 4359562752: debug :
virProcessActivateMaxFiles:1086 : Raised max files to 10240

and eliminates a case of what the documentation declares
to be invalid input to setrlimit anyway.

Signed-off-by: Laura Hild <lsh@jlab.org>
src/util/virprocess.c