From 03e471c41d8b1b6eb16c9714f387449f52fe5c1d Mon Sep 17 00:00:00 2001 From: Fiona Ebner Date: Mon, 18 Dec 2023 11:13:40 +0100 Subject: qemu_init: increase NOFILE soft limit on POSIX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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é Signed-off-by: Fiona Ebner Signed-off-by: Daniel P. Berrangé --- system/vl.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'system/vl.c') 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(); -- cgit 1.4.1 From 3b219d99af282b21b3c87ad948dbb21082e8fa1b Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrangé" Date: Fri, 8 Sep 2023 18:55:36 +0100 Subject: softmmu: remove obsolete comment about libvirt timeouts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For a long time now, libvirt has pre-created the monitor connection socket and passed the pre-opened FD into QEMU during startup. Thus libvirt does not have any timeouts waiting for the monitor socket to appear, it is immediately connected. Reviewed-by: Zhao Liu Signed-off-by: Daniel P. Berrangé --- system/vl.c | 1 - 1 file changed, 1 deletion(-) (limited to 'system/vl.c') diff --git a/system/vl.c b/system/vl.c index 95cd2d91c4..a82555ae15 100644 --- a/system/vl.c +++ b/system/vl.c @@ -1914,7 +1914,6 @@ static bool object_create_early(const char *type) * Allocation of large amounts of memory may delay * chardev initialization for too long, and trigger timeouts * on software that waits for a monitor socket to be created - * (e.g. libvirt). */ if (g_str_has_prefix(type, "memory-backend-")) { return false; -- cgit 1.4.1