virtiofsd: add --rlimit-nofile=NUM option
commit6dbb716877728ce4eb51619885ef6ef4ada9565f
authorStefan Hajnoczi <stefanha@redhat.com>
Fri, 1 May 2020 14:06:43 +0000 (1 15:06 +0100)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Fri, 1 May 2020 17:41:55 +0000 (1 18:41 +0100)
tree440fe374e3fe9616b76b7ec7e9f48a91cec90628
parent1c47613588ccff44422d4bdeea0dc36a0a308ec7
virtiofsd: add --rlimit-nofile=NUM option

Make it possible to specify the RLIMIT_NOFILE on the command-line.
Users running multiple virtiofsd processes should allocate a certain
number to each process so that the system-wide limit can never be
exhausted.

When this option is set to 0 the rlimit is left at its current value.
This is useful when a management tool wants to configure the rlimit
itself.

The default behavior remains unchanged: try to set the limit to
1,000,000 file descriptors if the current rlimit is lower.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20200501140644.220940-2-stefanha@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
tools/virtiofsd/fuse_lowlevel.h
tools/virtiofsd/helper.c
tools/virtiofsd/passthrough_ll.c