From nobody Sat Feb 7 18:34:19 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1687355317; cv=none; d=zohomail.com; s=zohoarc; b=bFwJ1zMIug+MixM1DSvRTFvdWGfjpeYIPiQ2HoRYUCVN2cABwMyM25/NDhVOJ5Q8ADlf2Dggj9tEoyiFt6KO0TxAEYfbvIjgn4T0IS39BpB8rv0k0NzT8Jgyz5CpLVZKSIgvXPE9aKXwYkvfWhZJ+4wKnhIyyySsS4RqMDm8Vlc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1687355317; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4BeP33TekH7TKM8g02lljAVeRHAqgdUFQx+4Z9jBFX8=; b=LocMrDxIxV2wadtPPzvptpmI5jCtcxchMtDzN+yrl+vvqycwmCD8zQ7Rr6lNRRJ1FlPbtPw9r2w/jb47BCS7ZswhpJ3oATXAYnbVftK/KS9oOl1oc/uAGUS7fi7MMtebT4IcPBwStrVbJeEl0Qf1Wtv1NICijvA6q3Feerpl+o0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1687355317657897.809972204202; Wed, 21 Jun 2023 06:48:37 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-185-izqDBJQ5N1qkAbJV1rVvdw-1; Wed, 21 Jun 2023 09:48:34 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 92B863C15FAA; Wed, 21 Jun 2023 13:48:30 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7C519112132E; Wed, 21 Jun 2023 13:48:30 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 220721946588; Wed, 21 Jun 2023 13:48:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2220D1946586 for ; Wed, 21 Jun 2023 13:32:35 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 15510425357; Wed, 21 Jun 2023 13:32:35 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.42.28.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 68CC0425358; Wed, 21 Jun 2023 13:32:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687355316; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=4BeP33TekH7TKM8g02lljAVeRHAqgdUFQx+4Z9jBFX8=; b=L7Uc45YQ22M+OWvBIsxhX5N8fqI+fDtW0xHQiJZ1cPbWI3GcPkzbs4y/ZdOCE2eiDy5MWr aJfTjUnqXmgRY+u0FYZzH92SsToFG03wPgZ23ol0J5Ib+8CVoWl5uV4Bn1w69nzvSse6wt e9YnpCK3oBg/o1gu9OJIQHD1rLgqZ9w= X-MC-Unique: izqDBJQ5N1qkAbJV1rVvdw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 1/9] src: remove After=local-fs.target from systemd units Date: Wed, 21 Jun 2023 14:32:24 +0100 Message-Id: <20230621133232.4156333-2-berrange@redhat.com> In-Reply-To: <20230621133232.4156333-1-berrange@redhat.com> References: <20230621133232.4156333-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1687355319415100001 All services are ordered after local-fs.target unless they have set DefaultDependencies=3Dno, which we do not do. https://gitlab.com/libvirt/libvirt/-/issues/489 Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Peter Krempa --- src/ch/virtchd.service.in | 1 - src/interface/virtinterfaced.service.in | 1 - src/libxl/virtxend.service.in | 1 - src/lxc/virtlxcd.service.in | 1 - src/network/virtnetworkd.service.in | 1 - src/node_device/virtnodedevd.service.in | 1 - src/nwfilter/virtnwfilterd.service.in | 1 - src/qemu/virtqemud.service.in | 1 - src/remote/libvirtd.service.in | 1 - src/remote/virtproxyd.service.in | 1 - src/secret/virtsecretd.service.in | 1 - src/storage/virtstoraged.service.in | 1 - src/util/virstring.c | 6 ++++++ src/vbox/virtvboxd.service.in | 1 - src/vz/virtvzd.service.in | 1 - 15 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/ch/virtchd.service.in b/src/ch/virtchd.service.in index a07c04a845..6e3b13446f 100644 --- a/src/ch/virtchd.service.in +++ b/src/ch/virtchd.service.in @@ -8,7 +8,6 @@ Wants=3Dsystemd-machined.service After=3Dnetwork.target After=3Ddbus.service After=3Dapparmor.service -After=3Dlocal-fs.target After=3Dremote-fs.target After=3Dsystemd-logind.service After=3Dsystemd-machined.service diff --git a/src/interface/virtinterfaced.service.in b/src/interface/virtin= terfaced.service.in index 1be3ab32dc..5cb2cd19dc 100644 --- a/src/interface/virtinterfaced.service.in +++ b/src/interface/virtinterfaced.service.in @@ -7,7 +7,6 @@ Requires=3Dvirtinterfaced-admin.socket After=3Dnetwork.target After=3Ddbus.service After=3Dapparmor.service -After=3Dlocal-fs.target Documentation=3Dman:virtinterfaced(8) Documentation=3Dhttps://libvirt.org =20 diff --git a/src/libxl/virtxend.service.in b/src/libxl/virtxend.service.in index abb1972777..c6a88f7fe9 100644 --- a/src/libxl/virtxend.service.in +++ b/src/libxl/virtxend.service.in @@ -8,7 +8,6 @@ Wants=3Dvirtlockd.socket After=3Dnetwork.target After=3Ddbus.service After=3Dapparmor.service -After=3Dlocal-fs.target After=3Dremote-fs.target After=3Dxencommons.service Conflicts=3Dxendomains.service diff --git a/src/lxc/virtlxcd.service.in b/src/lxc/virtlxcd.service.in index 2623f7375a..06c70ccde2 100644 --- a/src/lxc/virtlxcd.service.in +++ b/src/lxc/virtlxcd.service.in @@ -8,7 +8,6 @@ Wants=3Dsystemd-machined.service After=3Dnetwork.target After=3Ddbus.service After=3Dapparmor.service -After=3Dlocal-fs.target After=3Dremote-fs.target After=3Dsystemd-logind.service After=3Dsystemd-machined.service diff --git a/src/network/virtnetworkd.service.in b/src/network/virtnetworkd= .service.in index 48423e777d..f35cccb8f7 100644 --- a/src/network/virtnetworkd.service.in +++ b/src/network/virtnetworkd.service.in @@ -10,7 +10,6 @@ After=3Diptables.service After=3Dip6tables.service After=3Ddbus.service After=3Dapparmor.service -After=3Dlocal-fs.target Documentation=3Dman:virtnetworkd(8) Documentation=3Dhttps://libvirt.org =20 diff --git a/src/node_device/virtnodedevd.service.in b/src/node_device/virt= nodedevd.service.in index 3ceed30f29..2ac41db32e 100644 --- a/src/node_device/virtnodedevd.service.in +++ b/src/node_device/virtnodedevd.service.in @@ -7,7 +7,6 @@ Requires=3Dvirtnodedevd-admin.socket After=3Dnetwork.target After=3Ddbus.service After=3Dapparmor.service -After=3Dlocal-fs.target Documentation=3Dman:virtnodedevd(8) Documentation=3Dhttps://libvirt.org =20 diff --git a/src/nwfilter/virtnwfilterd.service.in b/src/nwfilter/virtnwfil= terd.service.in index 37fa54d684..d6e98240a8 100644 --- a/src/nwfilter/virtnwfilterd.service.in +++ b/src/nwfilter/virtnwfilterd.service.in @@ -7,7 +7,6 @@ Requires=3Dvirtnwfilterd-admin.socket After=3Dnetwork.target After=3Ddbus.service After=3Dapparmor.service -After=3Dlocal-fs.target Documentation=3Dman:virtnwfilterd(8) Documentation=3Dhttps://libvirt.org =20 diff --git a/src/qemu/virtqemud.service.in b/src/qemu/virtqemud.service.in index 032cbcbbf0..46917b746d 100644 --- a/src/qemu/virtqemud.service.in +++ b/src/qemu/virtqemud.service.in @@ -10,7 +10,6 @@ Wants=3Dsystemd-machined.service After=3Dnetwork.target After=3Ddbus.service After=3Dapparmor.service -After=3Dlocal-fs.target After=3Dremote-fs.target After=3Dsystemd-logind.service After=3Dsystemd-machined.service diff --git a/src/remote/libvirtd.service.in b/src/remote/libvirtd.service.in index 11507207a1..b691d35938 100644 --- a/src/remote/libvirtd.service.in +++ b/src/remote/libvirtd.service.in @@ -16,7 +16,6 @@ After=3Dip6tables.service After=3Ddbus.service After=3Discsid.service After=3Dapparmor.service -After=3Dlocal-fs.target After=3Dremote-fs.target After=3Dsystemd-logind.service After=3Dsystemd-machined.service diff --git a/src/remote/virtproxyd.service.in b/src/remote/virtproxyd.servi= ce.in index dd3bdf3429..9b829641f7 100644 --- a/src/remote/virtproxyd.service.in +++ b/src/remote/virtproxyd.service.in @@ -7,7 +7,6 @@ Requires=3Dvirtproxyd-admin.socket After=3Dnetwork.target After=3Ddbus.service After=3Dapparmor.service -After=3Dlocal-fs.target Documentation=3Dman:virtproxyd(8) Documentation=3Dhttps://libvirt.org =20 diff --git a/src/secret/virtsecretd.service.in b/src/secret/virtsecretd.ser= vice.in index 774cfc3ecd..3804fe553b 100644 --- a/src/secret/virtsecretd.service.in +++ b/src/secret/virtsecretd.service.in @@ -7,7 +7,6 @@ Requires=3Dvirtsecretd-admin.socket After=3Dnetwork.target After=3Ddbus.service After=3Dapparmor.service -After=3Dlocal-fs.target Documentation=3Dman:virtsecretd(8) Documentation=3Dhttps://libvirt.org =20 diff --git a/src/storage/virtstoraged.service.in b/src/storage/virtstoraged= .service.in index e1a1ea6820..235fbc6798 100644 --- a/src/storage/virtstoraged.service.in +++ b/src/storage/virtstoraged.service.in @@ -8,7 +8,6 @@ After=3Dnetwork.target After=3Ddbus.service After=3Discsid.service After=3Dapparmor.service -After=3Dlocal-fs.target After=3Dremote-fs.target Documentation=3Dman:virtstoraged(8) Documentation=3Dhttps://libvirt.org diff --git a/src/util/virstring.c b/src/util/virstring.c index 6b728ff047..e189b9de31 100644 --- a/src/util/virstring.c +++ b/src/util/virstring.c @@ -50,6 +50,7 @@ virStrToLong_i(char const *s, char **end_ptr, int base, i= nt *result) =20 errno =3D 0; val =3D g_ascii_strtoll(s, &p, base); + g_assert(errno !=3D EAGAIN); err =3D (errno || (!end_ptr && *p) || p =3D=3D s || (int) val !=3D val= ); if (end_ptr) *end_ptr =3D p; @@ -71,6 +72,7 @@ virStrToLong_ui(char const *s, char **end_ptr, int base, = unsigned int *result) =20 errno =3D 0; val =3D g_ascii_strtoull(s, &p, base); + g_assert(errno !=3D EAGAIN); =20 /* This one's tricky. We _want_ to allow "-1" as shorthand for * UINT_MAX regardless of whether long is 32-bit or 64-bit. But @@ -103,6 +105,7 @@ virStrToLong_uip(char const *s, char **end_ptr, int bas= e, unsigned int *result) =20 errno =3D 0; val =3D g_ascii_strtoull(s, &p, base); + g_assert(errno !=3D EAGAIN); err =3D (memchr(s, '-', p - s) || errno || (!end_ptr && *p) || p =3D=3D s || (unsigned int) val != =3D val); if (end_ptr) @@ -160,6 +163,7 @@ virStrToLong_ulp(char const *s, char **end_ptr, int bas= e, =20 errno =3D 0; val =3D g_ascii_strtoull(s, &p, base); + g_assert(errno !=3D EAGAIN); err =3D (memchr(s, '-', p - s) || errno || (!end_ptr && *p) || p =3D=3D s || (unsigned long) val = !=3D val); if (end_ptr) @@ -202,6 +206,7 @@ virStrToLong_ull(char const *s, char **end_ptr, int bas= e, =20 errno =3D 0; val =3D g_ascii_strtoull(s, &p, base); + g_assert(errno !=3D EAGAIN); err =3D (errno || (!end_ptr && *p) || p =3D=3D s); if (end_ptr) *end_ptr =3D p; @@ -223,6 +228,7 @@ virStrToLong_ullp(char const *s, char **end_ptr, int ba= se, =20 errno =3D 0; val =3D g_ascii_strtoull(s, &p, base); + g_assert(errno !=3D EAGAIN); err =3D (memchr(s, '-', p - s) || errno || (!end_ptr && *p) || p =3D=3D s); if (end_ptr) diff --git a/src/vbox/virtvboxd.service.in b/src/vbox/virtvboxd.service.in index e73206591a..a567ed2443 100644 --- a/src/vbox/virtvboxd.service.in +++ b/src/vbox/virtvboxd.service.in @@ -7,7 +7,6 @@ Requires=3Dvirtvboxd-admin.socket After=3Dnetwork.target After=3Ddbus.service After=3Dapparmor.service -After=3Dlocal-fs.target After=3Dremote-fs.target Documentation=3Dman:virtvboxd(8) Documentation=3Dhttps://libvirt.org diff --git a/src/vz/virtvzd.service.in b/src/vz/virtvzd.service.in index bd98d96262..5521e89e10 100644 --- a/src/vz/virtvzd.service.in +++ b/src/vz/virtvzd.service.in @@ -7,7 +7,6 @@ Requires=3Dvirtvzd-admin.socket After=3Dnetwork.target After=3Ddbus.service After=3Dapparmor.service -After=3Dlocal-fs.target After=3Dremote-fs.target Documentation=3Dman:virtvzd(8) Documentation=3Dhttps://libvirt.org --=20 2.40.1 From nobody Sat Feb 7 18:34:19 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1687354524; cv=none; d=zohomail.com; s=zohoarc; b=j94eZoI/MQPthNdqdHLUwzp4vVOaXYFBEaVdbtVhtagfeFXTnRy4VyQnOGE3Vj1tLREkRSruKAdLoykfOY6hqi/+8XzfiWso+MzQ740hO4RP5puo77mWWrMZ6JZZd29ZmMFHsrmb2cY54okgEv1jepZ6v4ioAJ0J7LiAjbVd5Cg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1687354524; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=WiOeJKeQKs+zKQjyFVYxnK++IjtN5Dsf5/UDP6ai0S4=; b=JiZ1GfNAxMZkkL3z+UX2BuW++uDbRpbz+rJOK76bWFploP2QV13Vc8m6ti4TJMLshNhssfmp0ciBT6G1x5KbccgfIMoQyfLzVdylGM6t/yEq/9MnmErOg7bU8sR+e2r/H1Lh6P9dBE5CgjkOxwy49BlCyALRpBIY5UcwJoiYozc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1687354524911426.5635948659419; Wed, 21 Jun 2023 06:35:24 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-646-gGOT06ehM8-ankTHWtBmHA-1; Wed, 21 Jun 2023 09:35:18 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A4C903800522; Wed, 21 Jun 2023 13:34:53 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 90049492B02; Wed, 21 Jun 2023 13:34:53 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 726F81946588; Wed, 21 Jun 2023 13:34:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id DC2BD1946586 for ; Wed, 21 Jun 2023 13:32:35 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id BCBF7425357; Wed, 21 Jun 2023 13:32:35 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.42.28.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 52DA640D1A4; Wed, 21 Jun 2023 13:32:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687354524; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=WiOeJKeQKs+zKQjyFVYxnK++IjtN5Dsf5/UDP6ai0S4=; b=Cc/xlXLqfXSZAekzB0bw7nIuB6Rd0QoWUsskks852sN/E6bnNQ92+X8CBeYlcWXF1HpNej PXaz2NQzXt6tYhP7yCQRq+PHu7mo73bjNPpCGFjf/96+VMQVsofavJ90oGO/0O1WQ+uUQ1 LIned3QDuELcy+0TxJzhQw9H2RlkTSI= X-MC-Unique: gGOT06ehM8-ankTHWtBmHA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 2/9] src: remote deps on ip[6]tables/firewalld.service from systemd units Date: Wed, 21 Jun 2023 14:32:25 +0100 Message-Id: <20230621133232.4156333-3-berrange@redhat.com> In-Reply-To: <20230621133232.4156333-1-berrange@redhat.com> References: <20230621133232.4156333-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1687354525306100001 The unit files both have After=3Dnetwork.target, and this in turn implies After=3Dnetwork-pre.target. Both iptables.service & ip6tables.service have Before=3Dnetwork-pre.target since Fedora >=3D 35 and RHEL >=3D 8.4. When we first added the deps on ip[6]tables.service in commit 0756415f147dda15a417bd79eef9a62027d176e6 Author: Laine Stump Date: Fri May 1 00:05:50 2020 -0400 systemd: start libvirtd after firewalld/iptables services the Before=3Dnetwork-pre.target didn't exist, but we can rely on it now given our supported platforms matrix. The firewalld.service has similarly has a Before=3Dnetwork-pre.target, even when we took that commit above, so this dep was in face never actually needed. This answers the question posed in that above commit message about firewalld ordering. https://gitlab.com/libvirt/libvirt/-/issues/489 Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Peter Krempa --- src/network/virtnetworkd.service.in | 3 --- src/remote/libvirtd.service.in | 3 --- 2 files changed, 6 deletions(-) diff --git a/src/network/virtnetworkd.service.in b/src/network/virtnetworkd= .service.in index f35cccb8f7..3d7374715d 100644 --- a/src/network/virtnetworkd.service.in +++ b/src/network/virtnetworkd.service.in @@ -5,9 +5,6 @@ Requires=3Dvirtnetworkd.socket Requires=3Dvirtnetworkd-ro.socket Requires=3Dvirtnetworkd-admin.socket After=3Dnetwork.target -After=3Dfirewalld.service -After=3Diptables.service -After=3Dip6tables.service After=3Ddbus.service After=3Dapparmor.service Documentation=3Dman:virtnetworkd(8) diff --git a/src/remote/libvirtd.service.in b/src/remote/libvirtd.service.in index b691d35938..afda257228 100644 --- a/src/remote/libvirtd.service.in +++ b/src/remote/libvirtd.service.in @@ -10,9 +10,6 @@ Wants=3Dlibvirtd-admin.socket Wants=3Dvirtlockd.socket Wants=3Dsystemd-machined.service After=3Dnetwork.target -After=3Dfirewalld.service -After=3Diptables.service -After=3Dip6tables.service After=3Ddbus.service After=3Discsid.service After=3Dapparmor.service --=20 2.40.1 From nobody Sat Feb 7 18:34:19 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1687354471; cv=none; d=zohomail.com; s=zohoarc; b=XuV+HP3m9/IvYB5PqBD31acHP2s4LU534R67Pu7Xr/GNnhp0/1uA7qx03oPeOfsOj5G1laJaKjxHUX1XbGjOOQUZmlkOHdv5T2tJOrem2bBDnVfzqcUSSbNqJz/A2GXwCfiCJxD43fyV2OV/Mw//zGxIQJkUl12Qst4G1WJddUA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1687354471; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UnzpqJdjTRoPAvMFJXJ5Fjz9CpPXmErOhKYtnO6uhTM=; b=b6JRNa+Vw5Y71RihbOUdUgpc95tcbX4qypS9SbnMb4fQcXTanc8bArtVQ7vsDwjuMM6jfsDbEd4DRpfQXKKiNiVgL2PlHuK7ACD8BnHpgjK9nfVVQced8AiO1byq1EMIE/dGtHdzb3bip1n2dJJmswl6Mz759RxOKqnJCGZZA5U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1687354471417624.0120320525798; Wed, 21 Jun 2023 06:34:31 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-583-yzhDVOctMVuBjnWHhCXnLw-1; Wed, 21 Jun 2023 09:34:20 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 08F093C1C4D4; Wed, 21 Jun 2023 13:33:18 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id EB8E3492B01; Wed, 21 Jun 2023 13:33:17 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D39E01946587; Wed, 21 Jun 2023 13:33:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6D4EB1946586 for ; Wed, 21 Jun 2023 13:32:36 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 5D9DF425357; Wed, 21 Jun 2023 13:32:36 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.42.28.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id EF4E240D1A4; Wed, 21 Jun 2023 13:32:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687354470; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=UnzpqJdjTRoPAvMFJXJ5Fjz9CpPXmErOhKYtnO6uhTM=; b=Kw2hq8sduZFz336DjhGOFOz8+OK2eKD44U2BSbmSaHjiH/HJHauy/bpqWtiSq40NVVzt9X il14Ql5Vrp0ppeLKuXB6S4FQs4RNfWvilU4D7NN5P/jWJGLAkQjhCAd5sPR6aNov8IF8I8 asOQl2uNj58QSAfAxVtmz4X7vJMNXnE= X-MC-Unique: yzhDVOctMVuBjnWHhCXnLw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 3/9] util: remove pointless wrappers for setrlimit/getrlimit Date: Wed, 21 Jun 2023 14:32:26 +0100 Message-Id: <20230621133232.4156333-4-berrange@redhat.com> In-Reply-To: <20230621133232.4156333-1-berrange@redhat.com> References: <20230621133232.4156333-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1687354471793100001 These wrappers added no semantic difference over calling the system function directly. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Peter Krempa --- src/util/virprocess.c | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/util/virprocess.c b/src/util/virprocess.c index 2fd9b406a1..0462ae8465 100644 --- a/src/util/virprocess.c +++ b/src/util/virprocess.c @@ -736,24 +736,6 @@ virProcessPrLimit(pid_t pid G_GNUC_UNUSED, } #endif =20 -#if WITH_GETRLIMIT -static int -virProcessGetRLimit(int resource, - struct rlimit *old_limit) -{ - return getrlimit(resource, old_limit); -} -#endif /* WITH_GETRLIMIT */ - -#if WITH_SETRLIMIT -static int -virProcessSetRLimit(int resource, - const struct rlimit *new_limit) -{ - return setrlimit(resource, new_limit); -} -#endif /* WITH_SETRLIMIT */ - #if WITH_GETRLIMIT static const char* virProcessLimitResourceToLabel(int resource) @@ -876,7 +858,7 @@ virProcessGetLimit(pid_t pid, if (virProcessGetLimitFromProc(pid, resource, old_limit) =3D=3D 0) return 0; =20 - if (same_process && virProcessGetRLimit(resource, old_limit) =3D=3D 0) + if (same_process && getrlimit(resource, old_limit) =3D=3D 0) return 0; =20 return -1; @@ -895,7 +877,7 @@ virProcessSetLimit(pid_t pid, if (virProcessPrLimit(pid, resource, new_limit, NULL) =3D=3D 0) return 0; =20 - if (same_process && virProcessSetRLimit(resource, new_limit) =3D=3D 0) + if (same_process && setrlimit(resource, new_limit) =3D=3D 0) return 0; =20 return -1; --=20 2.40.1 From nobody Sat Feb 7 18:34:19 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1687354470; cv=none; d=zohomail.com; s=zohoarc; b=lSto02GsX526XbNQ/KfEQkm5nBRE3ezzdPmcxaOX9f1LHV2FIvP8Q/Mb3o6bWlkdtm3dvBTUagn0a51iIy7qhMtQEr6E2xyIF4PtA7bTv5OueY/uIjyeYI8/0NKFvaFNCIZj/U1fSQiWskahoEWRkZwLPpFIaPKv4BgAis9lfiE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1687354470; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oWr7hbkbYyPwMd57nXw86Vm9XcyzpBUQ3wNmz8jWWD0=; b=JWu0KDwe1dxgvj9Eg1oO5LkUbKr16/ze5qBwbMUapZB872CdIFAHyIQ0TVbcygHpxtiTcnnpeEnHTjEdFKgXBp/tdb+smc9Lau83mDaPA6mxezjiNTKIdawBlbuVsVOFf+Svm8pY3w7RsEU6BuduifRBOxPpPpXVhzsNRkjguVk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1687354470070520.5371391102987; Wed, 21 Jun 2023 06:34:30 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-67-5ysaFXJ1Og6KzzmEzRzd-Q-1; Wed, 21 Jun 2023 09:34:07 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 984808910FC; Wed, 21 Jun 2023 13:32:50 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4306540C2063; Wed, 21 Jun 2023 13:32:49 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8E9BC1946A41; Wed, 21 Jun 2023 13:32:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 28C9D1946586 for ; Wed, 21 Jun 2023 13:32:37 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 09CC9425356; Wed, 21 Jun 2023 13:32:37 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.42.28.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8E912425357; Wed, 21 Jun 2023 13:32:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687354469; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=oWr7hbkbYyPwMd57nXw86Vm9XcyzpBUQ3wNmz8jWWD0=; b=isYPJpfIzsdjC9LOcwbfWvgsIFyxIVRqufJVQln0YaFhreAlEW06jUJSWnpSqvoVQfsTEQ DcjSQG0BpgMtdIIQAbzRBy7DT1pqBOEgpTvP7Qt+XL0Dq96dsDnNv480OFm8xMlvwo+6Gv SgMobw4G0GN07eMsEy65kG4PFPObuy4= X-MC-Unique: 5ysaFXJ1Og6KzzmEzRzd-Q-1 X-Original-To: libvir-list@listman.corp.redhat.com From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 4/9] util: add helper for raising the max files limit Date: Wed, 21 Jun 2023 14:32:27 +0100 Message-Id: <20230621133232.4156333-5-berrange@redhat.com> In-Reply-To: <20230621133232.4156333-1-berrange@redhat.com> References: <20230621133232.4156333-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1687354471800100002 Historically the max files limit for processes has always been 1024, because going beyond this is incompatible with the select() function. None the less most apps these days will use poll() so should not be limited in this way. Since systemd >=3D 240, the hard limit will be 500k, while the soft limit remains at 1k. Applications which don't use select() should raise their soft limit to match the hard limit during their startup. This function provides a convenient helper to do this limit raising. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Peter Krempa --- src/libvirt_private.syms | 1 + src/util/virprocess.c | 34 ++++++++++++++++++++++++++++++++++ src/util/virprocess.h | 1 + 3 files changed, 36 insertions(+) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index fb7ad9c855..3071dec13a 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -3171,6 +3171,7 @@ virPortAllocatorSetUsed; =20 # util/virprocess.h virProcessAbort; +virProcessActivateMaxFiles; virProcessExitWithStatus; virProcessGetAffinity; virProcessGetMaxMemLock; diff --git a/src/util/virprocess.c b/src/util/virprocess.c index 0462ae8465..a26683f333 100644 --- a/src/util/virprocess.c +++ b/src/util/virprocess.c @@ -1048,6 +1048,35 @@ virProcessSetMaxFiles(pid_t pid, unsigned int files) =20 return 0; } + +void +virProcessActivateMaxFiles(void) +{ + struct rlimit maxfiles =3D {0}; + + /* + * Ignore errors since we might be inside a container with seccomp + * filters and limits preset to suitable values. + */ + if (getrlimit(RLIMIT_NOFILE, &maxfiles) < 0) { + VIR_DEBUG("Unable to fetch process max files limit: %s", + g_strerror(errno)); + return; + } + + VIR_DEBUG("Initial max files was %llu", (unsigned long long)maxfiles.r= lim_cur); + + maxfiles.rlim_cur =3D maxfiles.rlim_max; + + if (setrlimit(RLIMIT_NOFILE, &maxfiles) < 0) { + VIR_DEBUG("Unable to set process max files limit to %llu: %s", + (unsigned long long)maxfiles.rlim_cur, g_strerror(errno)= ); + return; + } + + VIR_DEBUG("Raised max files to %llu", (unsigned long long)maxfiles.rli= m_cur); +} + #else /* ! (WITH_SETRLIMIT && defined(RLIMIT_NOFILE)) */ int virProcessSetMaxFiles(pid_t pid G_GNUC_UNUSED, @@ -1056,6 +1085,11 @@ virProcessSetMaxFiles(pid_t pid G_GNUC_UNUSED, virReportSystemError(ENOSYS, "%s", _("Not supported on this platform")= ); return -1; } + +void +virProcessActivateMaxFiles(void) +{ +} #endif /* ! (WITH_SETRLIMIT && defined(RLIMIT_NOFILE)) */ =20 #if WITH_SETRLIMIT && defined(RLIMIT_CORE) diff --git a/src/util/virprocess.h b/src/util/virprocess.h index c18f87e80e..6008cca4af 100644 --- a/src/util/virprocess.h +++ b/src/util/virprocess.h @@ -81,6 +81,7 @@ int virProcessSetMaxMemLock(pid_t pid, unsigned long long= bytes) G_NO_INLINE; int virProcessSetMaxProcesses(pid_t pid, unsigned int procs); int virProcessSetMaxFiles(pid_t pid, unsigned int files); int virProcessSetMaxCoreSize(pid_t pid, unsigned long long bytes); +void virProcessActivateMaxFiles(void); =20 int virProcessGetMaxMemLock(pid_t pid, unsigned long long *bytes) G_NO_INL= INE; =20 --=20 2.40.1 From nobody Sat Feb 7 18:34:19 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1687354489; cv=none; d=zohomail.com; s=zohoarc; b=Y82bYAxNEm6Wi0pRP92ngqqVqAMv64uld4mvYmIC6LYYuktrSOEqC5P57e/JixaTHm4S3IDBwreQOsGBfrM4k00ui81jlchFgHQf+Di2V5PPn5cxwuaRUJ9NrO1uL4JHhMxuIGFz0GRTriSW9dsGIKRBC+OgYGz4bdvUKJlwVDs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1687354489; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=zBbf0iHZqW/dYN678xypU1de3dIiQeMzWqZml192l04=; b=f+XQBq7FKpgcX3P6wqDC1MJFyEow3ScrYBk+o4dHos5tn0yP+tdpmEo5D7Lsjh46ZshbOMozYs/cm+ML2QluNPvnSvngqqtDAe+8JgX6MjfJDHkilg+NDvTXI3HnuESR6kUPQUDwBkx6/yS8HRAbkVLpKOjR+W8byZ1PULt3Sys= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1687354489731434.2287028412246; Wed, 21 Jun 2023 06:34:49 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-589-ptTqQgzDPTe1JlH1AtYgJw-1; Wed, 21 Jun 2023 09:34:41 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 29A26299E76C; Wed, 21 Jun 2023 13:34:11 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1546C15230A2; Wed, 21 Jun 2023 13:34:11 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2B1EC1946587; Wed, 21 Jun 2023 13:34:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id ADCBB1946586 for ; Wed, 21 Jun 2023 13:32:37 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 9BD0340D1A4; Wed, 21 Jun 2023 13:32:37 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.42.28.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3811F425357; Wed, 21 Jun 2023 13:32:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687354488; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=zBbf0iHZqW/dYN678xypU1de3dIiQeMzWqZml192l04=; b=hMD5Wrtw8VO8A/fUFBC4CFD5JynumXK6cutOaJnZSxQAqolkTOaRtz4HLU/Swxm7gLVqT3 sxR4Z4A9TcVNneT1HjHvVUMOzTEy0Bj5O8U6Tdn0KifSJffEEEhbtg/kF9FTNRJGJ376vS warcxtVO4mYlUuMewuIRTIuyLlgHiNc= X-MC-Unique: ptTqQgzDPTe1JlH1AtYgJw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 5/9] rpc: automatically raise max file limit in all daemons Date: Wed, 21 Jun 2023 14:32:28 +0100 Message-Id: <20230621133232.4156333-6-berrange@redhat.com> In-Reply-To: <20230621133232.4156333-1-berrange@redhat.com> References: <20230621133232.4156333-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1687354491864100001 None of our daemons use select(), so it is safe to raise the max file limit to its maximum on startup. https://gitlab.com/libvirt/libvirt/-/issues/489 Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Peter Krempa --- src/rpc/virnetdaemon.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rpc/virnetdaemon.c b/src/rpc/virnetdaemon.c index 1292faa078..554b8852e4 100644 --- a/src/rpc/virnetdaemon.c +++ b/src/rpc/virnetdaemon.c @@ -33,6 +33,7 @@ #include "virnetserver.h" #include "virgdbus.h" #include "virhash.h" +#include "virprocess.h" #include "virsystemd.h" =20 #define VIR_FROM_THIS VIR_FROM_RPC @@ -151,6 +152,8 @@ virNetDaemonNew(void) dmn->privileged =3D geteuid() =3D=3D 0; dmn->autoShutdownInhibitFd =3D -1; =20 + virProcessActivateMaxFiles(); + if (virEventRegisterDefaultImpl() < 0) goto error; =20 --=20 2.40.1 From nobody Sat Feb 7 18:34:19 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1687354471; cv=none; d=zohomail.com; s=zohoarc; b=ASDgoiYkWPaQmZb3i4hFoDIxFx+21tpTktinjG30y9ifDL+02vpBxpPDSlPdIcCgeRqwI0+Ie5ulQheVgLvgD9ajfp7SXh5GbQwj6y1i5s+E+s3SmWAYmdX4crB56qK1tidgu/Hc3+gheW0VkOn2a5zjH0u3lr4B16n85A+de0M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1687354471; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=jUc73aGi1s2a0tNQw/YQISdXh1GL2WcWx3p46v10lWM=; b=BBkGqSi4G0bIittiykUN4ru3tl9bRFyDwmBmK5pZrIM8GcGPsWl9jGH7/Uoc/NYrPyQg3In/2W2OQZOHAMlkx+y2HVOz9tS0e7mz1Xsvg3xRcYbMyGg8fVevUy9GeoRSHGecdzu7jvLpwmg0e10lDbfX0Mafw+HrNOw8RtBIfYU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1687354471911503.97447152495454; Wed, 21 Jun 2023 06:34:31 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-58-9Qhu6wwWNkq3U3qcjbonyA-1; Wed, 21 Jun 2023 09:34:18 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2D1BB281294A; Wed, 21 Jun 2023 13:32:52 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 19CF09E9C; Wed, 21 Jun 2023 13:32:52 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E73141946587; Wed, 21 Jun 2023 13:32:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5A77F1946586 for ; Wed, 21 Jun 2023 13:32:38 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 3CDDD425356; Wed, 21 Jun 2023 13:32:38 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.42.28.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id C98E4425359; Wed, 21 Jun 2023 13:32:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687354471; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=jUc73aGi1s2a0tNQw/YQISdXh1GL2WcWx3p46v10lWM=; b=duug4zf286j8/kqCu6FcLv4YdaBretvZiXpdO4j8t8h4+ibqu9heW8ByOdHd+FioNcPGQ/ jNhw3cOYyarb7ioZogRIa1IDxvdjKVwfe2yr65lmqIkNKdqpsqdmTkOiQLDak1yBtpO945 bn2kC7zDmlxPLoao9ajd3dkyg0PE0gI= X-MC-Unique: 9Qhu6wwWNkq3U3qcjbonyA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 6/9] src: set max open file limit to match systemd >= 240 defaults Date: Wed, 21 Jun 2023 14:32:29 +0100 Message-Id: <20230621133232.4156333-7-berrange@redhat.com> In-Reply-To: <20230621133232.4156333-1-berrange@redhat.com> References: <20230621133232.4156333-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1687354474127100001 Since systemd 240, all services get an open file hard limit of 500k, and a soft limit of 1024. This limit means apps are safe to use select() by default which is limited to 1024 FDs. Apps which don't use select() are expected to simply set their soft limit to match the hard limit during startup. With our current unit file settings we've been effectively reducing the max open files we have on most modern systems. https://gitlab.com/libvirt/libvirt/-/issues/489 Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Peter Krempa --- src/ch/virtchd.service.in | 9 ++++----- src/locking/virtlockd.service.in | 8 ++++---- src/logging/virtlogd.service.in | 11 ++++------- src/lxc/virtlxcd.service.in | 9 ++++----- src/qemu/virtqemud.service.in | 9 ++++----- src/remote/libvirtd.service.in | 9 ++++----- tests/virshtest.c | 1 + tools/virsh.c | 2 +- 8 files changed, 26 insertions(+), 32 deletions(-) diff --git a/src/ch/virtchd.service.in b/src/ch/virtchd.service.in index 6e3b13446f..22314bc907 100644 --- a/src/ch/virtchd.service.in +++ b/src/ch/virtchd.service.in @@ -22,11 +22,10 @@ ExecStart=3D@sbindir@/virtchd $VIRTCHD_ARGS ExecReload=3D/bin/kill -HUP $MAINPID KillMode=3Dprocess Restart=3Don-failure -# At least 2 FD per guest (eg ch monitor + ch socket). -# eg if we want to support 4096 guests, we'll typically need 8192 FDs -# If changing this, also consider virtlogd.service & virtlockd.service -# limits which are also related to number of guests -LimitNOFILE=3D8192 +# Raise hard limits to match behaviour of systemd >=3D 240. +# During startup, daemon will set soft limit to match hard limit +# per systemd recommendations +LimitNOFile=3D512000:1024 # The cgroups pids controller can limit the number of tasks started by # the daemon, which can limit the number of domains for some hypervisors. # A conservative default of 8 tasks per guest results in a TasksMax of diff --git a/src/locking/virtlockd.service.in b/src/locking/virtlockd.servi= ce.in index 23054369d5..f1792dcb43 100644 --- a/src/locking/virtlockd.service.in +++ b/src/locking/virtlockd.service.in @@ -15,10 +15,10 @@ ExecReload=3D/bin/kill -USR1 $MAINPID # cause the machine to be fenced (rebooted), so make # sure we discourage OOM killer OOMScoreAdjust=3D-900 -# Needs to allow for max guests * average disks per guest -# libvirtd.service written to expect 4096 guests, so if we -# allow for 10 disks per guest, we get: -LimitNOFILE=3D40960 +# Raise hard limits to match behaviour of systemd >=3D 240. +# During startup, daemon will set soft limit to match hard limit +# per systemd recommendations +LimitNOFile=3D512000:1024 =20 [Install] Also=3Dvirtlockd.socket diff --git a/src/logging/virtlogd.service.in b/src/logging/virtlogd.service= .in index e4aecd46a7..cef4053f59 100644 --- a/src/logging/virtlogd.service.in +++ b/src/logging/virtlogd.service.in @@ -15,13 +15,10 @@ ExecReload=3D/bin/kill -USR1 $MAINPID # cause the machine to be fenced (rebooted), so make # sure we discourage OOM killer OOMScoreAdjust=3D-900 -# Need to have at least one file open per guest (eg QEMU -# stdio log), but might be more (eg serial console logs) -# A common case is OpenStack which often has up to 4 file -# handles per guest. -# libvirtd.service written to expect 4096 guests, so if we -# guess at 4 files per guest here that is 16k: -LimitNOFILE=3D16384 +# Raise hard limits to match behaviour of systemd >=3D 240. +# During startup, daemon will set soft limit to match hard limit +# per systemd recommendations +LimitNOFile=3D512000:1024 =20 [Install] Also=3Dvirtlogd.socket diff --git a/src/lxc/virtlxcd.service.in b/src/lxc/virtlxcd.service.in index 06c70ccde2..59d7d26657 100644 --- a/src/lxc/virtlxcd.service.in +++ b/src/lxc/virtlxcd.service.in @@ -22,11 +22,10 @@ ExecStart=3D@sbindir@/virtlxcd $VIRTLXCD_ARGS ExecReload=3D/bin/kill -HUP $MAINPID KillMode=3Dprocess Restart=3Don-failure -# At least 1 FD per guest, often 2 (eg qemu monitor + qemu agent). -# eg if we want to support 4096 guests, we'll typically need 8192 FDs -# If changing this, also consider virtlogd.service & virtlockd.service -# limits which are also related to number of guests -LimitNOFILE=3D8192 +# Raise hard limits to match behaviour of systemd >=3D 240. +# During startup, daemon will set soft limit to match hard limit +# per systemd recommendations +LimitNOFile=3D512000:1024 # The cgroups pids controller can limit the number of tasks started by # the daemon, which can limit the number of domains for some hypervisors. # A conservative default of 8 tasks per guest results in a TasksMax of diff --git a/src/qemu/virtqemud.service.in b/src/qemu/virtqemud.service.in index 46917b746d..7e02f7ab51 100644 --- a/src/qemu/virtqemud.service.in +++ b/src/qemu/virtqemud.service.in @@ -24,11 +24,10 @@ ExecStart=3D@sbindir@/virtqemud $VIRTQEMUD_ARGS ExecReload=3D/bin/kill -HUP $MAINPID KillMode=3Dprocess Restart=3Don-failure -# At least 1 FD per guest, often 2 (eg qemu monitor + qemu agent). -# eg if we want to support 4096 guests, we'll typically need 8192 FDs -# If changing this, also consider virtlogd.service & virtlockd.service -# limits which are also related to number of guests -LimitNOFILE=3D8192 +# Raise hard limits to match behaviour of systemd >=3D 240. +# During startup, daemon will set soft limit to match hard limit +# per systemd recommendations +LimitNOFile=3D512000:1024 # The cgroups pids controller can limit the number of tasks started by # the daemon, which can limit the number of domains for some hypervisors. # A conservative default of 8 tasks per guest results in a TasksMax of diff --git a/src/remote/libvirtd.service.in b/src/remote/libvirtd.service.in index afda257228..28bcdb1220 100644 --- a/src/remote/libvirtd.service.in +++ b/src/remote/libvirtd.service.in @@ -29,11 +29,10 @@ ExecStart=3D@sbindir@/libvirtd $LIBVIRTD_ARGS ExecReload=3D/bin/kill -HUP $MAINPID KillMode=3Dprocess Restart=3Don-failure -# At least 1 FD per guest, often 2 (eg qemu monitor + qemu agent). -# eg if we want to support 4096 guests, we'll typically need 8192 FDs -# If changing this, also consider virtlogd.service & virtlockd.service -# limits which are also related to number of guests -LimitNOFILE=3D8192 +# Raise hard limits to match behaviour of systemd >=3D 240. +# During startup, daemon will set soft limit to match hard limit +# per systemd recommendations +LimitNOFile=3D512000:1024 # The cgroups pids controller can limit the number of tasks started by # the daemon, which can limit the number of domains for some hypervisors. # A conservative default of 8 tasks per guest results in a TasksMax of diff --git a/tests/virshtest.c b/tests/virshtest.c index cf834bb847..022cd075f9 100644 --- a/tests/virshtest.c +++ b/tests/virshtest.c @@ -118,6 +118,7 @@ testCompareOutputLit(const char *expectData, =20 cmd =3D virCommandNewArgs(argv); =20 + virCommandAddEnvPassCommon(cmd); virCommandAddEnvString(cmd, "LANG=3DC"); virCommandSetInputBuffer(cmd, empty); virCommandSetOutputBuffer(cmd, &actualData); diff --git a/tools/virsh.c b/tools/virsh.c index 963e886860..55a1ffca86 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -123,7 +123,7 @@ virshConnect(vshControl *ctl, const char *uri, bool rea= donly) keepalive_forced =3D true; } =20 - if (virPolkitAgentAvailable() && + if (0 && virPolkitAgentAvailable() && !(pkagent =3D virPolkitAgentCreate())) virResetLastError(); =20 --=20 2.40.1 From nobody Sat Feb 7 18:34:19 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1687355318; cv=none; d=zohomail.com; s=zohoarc; b=UUVqIsxeowZBamnrtH9H4kFWWDF8cLvYXhHmjObU7zvX2cnsC7LZPWOa3fnblZy1FXHAOWjmOHAnWgaqP3OANCjf5v2/Cq8f4A6N7Wf7HPNSs5gNdVJlow57ygn1udXc0F1lfr0F2EJjit1+kC7L94v9MXVpmwzlTbcLgQc9V5A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1687355318; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Uxj/Q+nGtBqvagc0hw2jCGzmjXI5pKwtimQg30qB2vA=; b=ax9h84uFNVCpTMpzRP1jlIfD+maURfu4PhxOEWqPovKORKPDREGO3QhMW5ccoxcAikJaW/zf8ytkPyG1igHFbmdnX0qlXC+lIMRFChdHrLm4wr4tl2580xGf6J4FiA5ogBH/K39jdM68beRNWTrRq6f5VaOLmx0FdXLzBOfSgDY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1687355318691597.8393629399394; Wed, 21 Jun 2023 06:48:38 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-621-yIFJOnjkMj2f9ZNDBFoXIA-1; Wed, 21 Jun 2023 09:48:35 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4C59F88711B; Wed, 21 Jun 2023 13:48:31 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 324AF207B2C4; Wed, 21 Jun 2023 13:48:31 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5A48019465B1; Wed, 21 Jun 2023 13:48:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id DC5801946586 for ; Wed, 21 Jun 2023 13:32:38 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id CCF71425356; Wed, 21 Jun 2023 13:32:38 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.42.28.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6B30740D1A4; Wed, 21 Jun 2023 13:32:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687355317; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Uxj/Q+nGtBqvagc0hw2jCGzmjXI5pKwtimQg30qB2vA=; b=XG8e0KkOL6pPWVyrjthQrS4QA7qSVWAs45RSuQk86bUR0CB7XuqF1M49L6Q/IbokimTq7L YUBh6tftVqYQLLQkN9UYWUpfdO1BdrHKs0aINPjIE69zzcxkRSFF3nO0big433kFXzZheI mxYvd+RtE2FowPVDExpS0klTtGp/fZQ= X-MC-Unique: yIFJOnjkMj2f9ZNDBFoXIA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 7/9] util: relax requirement for logind to be running Date: Wed, 21 Jun 2023 14:32:30 +0100 Message-Id: <20230621133232.4156333-8-berrange@redhat.com> In-Reply-To: <20230621133232.4156333-1-berrange@redhat.com> References: <20230621133232.4156333-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1687355320111100003 Historically we wanted to check if logind was actually running, not merely activatable, because on systems where systemd is installed, but the OS is booted into non-systemd init, we want to fallback to pm-utils. Requiring logind to be running, however, forces us to serialize libvirtd startup on startup of logind which is undesirable. We can relax this dependancy if we check whether systemd itself is running, which implies that logind will activated when we need it. https://gitlab.com/libvirt/libvirt/-/issues/489 Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Peter Krempa --- src/util/virsystemd.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c index 3112a1ba80..cd4de0eef8 100644 --- a/src/util/virsystemd.c +++ b/src/util/virsystemd.c @@ -184,9 +184,21 @@ virSystemdHasLogind(void) return ret; } =20 + /* + * Want to use logind if: + * - logind is already running + * Or + * - logind is not running, but this is a systemd host + * (rely on dbus activation) + */ if ((ret =3D virGDBusIsServiceRegistered("org.freedesktop.login1")) = =3D=3D -1) return ret; =20 + if (ret =3D=3D -2) { + if ((ret =3D virGDBusIsServiceRegistered("org.freedesktop.systemd1= ")) =3D=3D -1) + return ret; + } + g_atomic_int_set(&virSystemdHasLogindCachedValue, ret); return ret; } --=20 2.40.1 From nobody Sat Feb 7 18:34:19 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1687354741; cv=none; d=zohomail.com; s=zohoarc; b=MWuUIKTyaBqjbMsKbwQAKlCvBBANgsTYe/xlCi6v35/1PtnnxeFO3ixI7GMQVwfSk/zwmO3sZladOcZQEwFAxBA6tI41Gf1tlWKtUS7wCaWc1tvzvbK+iSxNFS/+0AVw5xDmuB1AmYD7509sis3+/eOVwCcJyRWijsr7jB3T2h0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1687354741; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=HV5pjPhg9vvpckwWJZgLLI5H6h2SqzvhmOG1EEq3Jxw=; b=TYmPDnbcPeAXA+Xk+7Pm4g3PRz4DSmsJR0cIv+um+wq4OOO+LHXGQWeExDV9hS+Ex5ooQg+f2WIrGB2RGR1SF99Nb/E8gMQf7GzKyc4UqFzP4ICfVsaHfwu6k+B6skxg5MUXBdKk+YQ0pZLq03LkIQt1ELMLye33SSgRJ2QT8uE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1687354741898652.7969624182632; Wed, 21 Jun 2023 06:39:01 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-583-JqDuU5PEPcm3t3x17pqPHQ-1; Wed, 21 Jun 2023 09:38:57 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 44F47104458E; Wed, 21 Jun 2023 13:38:54 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id D8CB8200BA8B; Wed, 21 Jun 2023 13:38:53 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 908DD1946587; Wed, 21 Jun 2023 13:38:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 983791946586 for ; Wed, 21 Jun 2023 13:32:39 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 7C9F8425357; Wed, 21 Jun 2023 13:32:39 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.42.28.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0924E492C13; Wed, 21 Jun 2023 13:32:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687354740; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=HV5pjPhg9vvpckwWJZgLLI5H6h2SqzvhmOG1EEq3Jxw=; b=ToUH4HtlGQarOXxBYmZN1328y7POiByxALnHm/4U4GMAtNHWDbvYzViGvRz3R2hSOy3gnk bUfelBTYx3HOXr2u4sBcwVYynrxNGSSMVlGEY+EKCqeC7hVChAcvAehFU4MQJkDwSu8fI5 wwTtQFQ7m/v5PErfSuLu9ho7PDdA+qU= X-MC-Unique: JqDuU5PEPcm3t3x17pqPHQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 8/9] src: remove dep on systemd-logind.service from unit files Date: Wed, 21 Jun 2023 14:32:31 +0100 Message-Id: <20230621133232.4156333-9-berrange@redhat.com> In-Reply-To: <20230621133232.4156333-1-berrange@redhat.com> References: <20230621133232.4156333-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1687354742157100001 After the previous commit we no longer require that logind is actually running, it merely has to be activatable. https://gitlab.com/libvirt/libvirt/-/issues/489 Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Peter Krempa --- src/ch/virtchd.service.in | 1 - src/lxc/virtlxcd.service.in | 1 - src/qemu/virtqemud.service.in | 1 - src/remote/libvirtd.service.in | 1 - 4 files changed, 4 deletions(-) diff --git a/src/ch/virtchd.service.in b/src/ch/virtchd.service.in index 22314bc907..be242fea78 100644 --- a/src/ch/virtchd.service.in +++ b/src/ch/virtchd.service.in @@ -9,7 +9,6 @@ After=3Dnetwork.target After=3Ddbus.service After=3Dapparmor.service After=3Dremote-fs.target -After=3Dsystemd-logind.service After=3Dsystemd-machined.service Documentation=3Dman:virtchd(8) Documentation=3Dhttps://libvirt.org diff --git a/src/lxc/virtlxcd.service.in b/src/lxc/virtlxcd.service.in index 59d7d26657..b615a3f32d 100644 --- a/src/lxc/virtlxcd.service.in +++ b/src/lxc/virtlxcd.service.in @@ -9,7 +9,6 @@ After=3Dnetwork.target After=3Ddbus.service After=3Dapparmor.service After=3Dremote-fs.target -After=3Dsystemd-logind.service After=3Dsystemd-machined.service Documentation=3Dman:virtlxcd(8) Documentation=3Dhttps://libvirt.org diff --git a/src/qemu/virtqemud.service.in b/src/qemu/virtqemud.service.in index 7e02f7ab51..e3dc738b8f 100644 --- a/src/qemu/virtqemud.service.in +++ b/src/qemu/virtqemud.service.in @@ -11,7 +11,6 @@ After=3Dnetwork.target After=3Ddbus.service After=3Dapparmor.service After=3Dremote-fs.target -After=3Dsystemd-logind.service After=3Dsystemd-machined.service Documentation=3Dman:virtqemud(8) Documentation=3Dhttps://libvirt.org diff --git a/src/remote/libvirtd.service.in b/src/remote/libvirtd.service.in index 28bcdb1220..abac58cb2c 100644 --- a/src/remote/libvirtd.service.in +++ b/src/remote/libvirtd.service.in @@ -14,7 +14,6 @@ After=3Ddbus.service After=3Discsid.service After=3Dapparmor.service After=3Dremote-fs.target -After=3Dsystemd-logind.service After=3Dsystemd-machined.service After=3Dxencommons.service Conflicts=3Dxendomains.service --=20 2.40.1 From nobody Sat Feb 7 18:34:19 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1687355086; cv=none; d=zohomail.com; s=zohoarc; b=AlUYKFkoYWOfLC4K+byjOLjRfY1KRFgpVE2GqTomyoEO8Cd5GQF9ihRy+/phlGg3DluWFrQJJP5OdX/XmvzWkajYyxwjfVxgXzFa2mNc684xkpXZSMDELt6Lc/egKyf052zatGXYWzFQjP7f5Yfe5FPjoCLt3z8o/LGRVHW7InA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1687355086; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=MdDryTle7JWG44HvqeRmcO8VFV0XBNj2bEl37AykttU=; b=Z+fmdz6Nm2V/GMr772IwW8zcUWdFRPVv6Wb25NrkFCECQwAXlZp/IRRju+qz8NbjYxbVntzJiE2qG/fz8bp7t2KgYdQl9/iqMzGrujUWdq/B1G+ZC6fcMw3+JFvVexnz9dlDKAGHI7fxvpuYGl18xK1eE1u7SRuM5lzfwsXxRzw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1687355086676205.50813332676364; Wed, 21 Jun 2023 06:44:46 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-79-jxIDAaspPFSFEfDNs2XL7A-1; Wed, 21 Jun 2023 09:44:39 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 919BD80027F; Wed, 21 Jun 2023 13:44:36 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0675D40C2070; Wed, 21 Jun 2023 13:44:36 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B3EB41946587; Wed, 21 Jun 2023 13:44:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id ABA7D1946586 for ; Wed, 21 Jun 2023 13:32:40 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 67820425376; Wed, 21 Jun 2023 13:32:40 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.42.28.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id C6890425356; Wed, 21 Jun 2023 13:32:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687355085; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=MdDryTle7JWG44HvqeRmcO8VFV0XBNj2bEl37AykttU=; b=VsXi0otWKYfH5avywT216h/6qG9ukDoQHKEGzI+hAvp+0Fs+G1Fk4k4gpj+LdqESxfNCnk UMlSsRAo94o88uPs4nwXDxfmyrYUtdlU5Fmnf9d033C2y15D135yCpVwxNXfChafctfr6s 8TN7Ww4HRgYCUXn2oE0At5ijauZUcX0= X-MC-Unique: jxIDAaspPFSFEfDNs2XL7A-1 X-Original-To: libvir-list@listman.corp.redhat.com From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 9/9] util: add logging about node suspend availability Date: Wed, 21 Jun 2023 14:32:32 +0100 Message-Id: <20230621133232.4156333-10-berrange@redhat.com> In-Reply-To: <20230621133232.4156333-1-berrange@redhat.com> References: <20230621133232.4156333-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1687355087275100001 Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Peter Krempa --- src/util/virnodesuspend.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util/virnodesuspend.c b/src/util/virnodesuspend.c index 01f387d6fa..91a7f10eb9 100644 --- a/src/util/virnodesuspend.c +++ b/src/util/virnodesuspend.c @@ -249,6 +249,7 @@ virNodeSuspendSupportsTargetPMUtils(unsigned int target= , bool *supported) * (i.e., the PM capability is supported) */ *supported =3D (status =3D=3D 0); + VIR_DEBUG("Node systemd pm-utils target %d: %d", target, *supported); =20 return 0; } @@ -257,6 +258,7 @@ static int virNodeSuspendSupportsTargetPMUtils(unsigned int target G_GNUC_UNUSED, bool *supported G_GNUC_UNUSED) { + VIR_DEBUG("Node systemd pm-utils target %d: unsupported platform", tar= get); return -2; } #endif /* ! WITH_PM_UTILS */ @@ -282,6 +284,7 @@ virNodeSuspendSupportsTargetSystemd(unsigned int target= , bool *supported) return ret; } =20 + VIR_DEBUG("Node systemd systemd target %d: %d", target, ret); return ret; } =20 --=20 2.40.1