aboutsummaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorFiona Ebner <f.ebner@proxmox.com>2023-12-18 11:13:40 +0100
committerDaniel P. Berrangé <berrange@redhat.com>2024-02-09 12:47:58 +0000
commit03e471c41d8b1b6eb16c9714f387449f52fe5c1d (patch)
tree4f14dd51f82a8a3c985b8ab9f1826e6d031f30e4 /system
parent52ed9f455ee0063958a1b18e54cab9a427fc422f (diff)
qemu_init: increase NOFILE soft limit on POSIX
In many configurations, e.g. multiple vNICs with multiple queues or with many Ceph OSDs, the default soft limit of 1024 is not enough. QEMU is supposed to work fine with file descriptors >= 1024 and does not use select() on POSIX. Bump the soft limit to the allowed hard limit to avoid issues with the aforementioned configurations. Of course the limit could be raised from the outside, but the man page of systemd.exec states about 'LimitNOFILE=': > Don't use. > [...] > Typically applications should increase their soft limit to the hard > limit on their own, if they are OK with working with file > descriptors above 1023, If the soft limit is already the same as the hard limit, avoid the superfluous setrlimit call. This can avoid a warning with a strict seccomp filter blocking setrlimit if NOFILE was already raised before executing QEMU. Buglink: https://bugzilla.proxmox.com/show_bug.cgi?id=4507 Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'system')
-rw-r--r--system/vl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/system/vl.c b/system/vl.c
index 2a0bd08ff1..95cd2d91c4 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -2778,6 +2778,8 @@ void qemu_init(int argc, char **argv)
error_init(argv[0]);
qemu_init_exec_dir(argv[0]);
+ os_setup_limits();
+
qemu_init_arch_modules();
qemu_init_subsystems();