From nobody Mon Feb 9 15:11:29 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=1695833248; cv=none; d=zohomail.com; s=zohoarc; b=RfAxBKs5P2scogx/00hdyApDN8TlNwUDA0YP04z2YuyYpo6UYk0AQAX7Ok7+TVA3aB2oG6v5VU0Wn/PH18IAX9M0RM/kWwYtYGdrTXJpTymReXwEQUe0B2IFZi7uFKISTZ8OvOqnUqpeaAPb++yr58tvcRMfOjSd6ZOIOzfn9wQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695833248; 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=AMs2A/vRjGbTk/9yhz+qBhpw+VpjO5WHi4HnDjAeIS0=; b=Pv3r8EUqEBHPgjbreIQEIlKMKoWNHo15vxDqjM5Ya749wHyVbNMbnORntsRINoll6wCh5sXycNMDyGE/+ooPgdvMQRSY6tDlq4ESAclNCSPIZbgzNW7VRbkomxaNlZjCjhzsP2B7RjfrD0rSml1Q7SKCFo0p4u1Wbh4x27qSfSM= 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 1695833248400683.7983893553998; Wed, 27 Sep 2023 09:47:28 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.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-465-IEHInSJ2Nsu3fva7eqLOUA-1; Wed, 27 Sep 2023 12:47:23 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5A4393C17710; Wed, 27 Sep 2023 16:47:19 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3FECE176C3; Wed, 27 Sep 2023 16:47:19 +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 9BBD519465BB; Wed, 27 Sep 2023 16:47:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A090819466EF for ; Wed, 27 Sep 2023 16:20:56 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 4E44E1054FCA; Wed, 27 Sep 2023 16:19:48 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.45.226.180]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D68B41054FC8 for ; Wed, 27 Sep 2023 16:19:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695833247; 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=AMs2A/vRjGbTk/9yhz+qBhpw+VpjO5WHi4HnDjAeIS0=; b=a8oMXCR435P6RUAf+UPe8aJKgJKnIHinozfW87jnu1WNLIRJ3vyYobLfnyxwsYkYvAcau3 MESvPesuFWM8kWogZc9F7WuH6pP8IqfoaIXneLc96Dci1eRUlaxzUgDONuZfh7VaOiBM4q lc20IZfIu1QQLLLPhAIS/FbZbU5SYvI= X-MC-Unique: IEHInSJ2Nsu3fva7eqLOUA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH v2 16/33] systemd: Switch virtchd to common templates Date: Wed, 27 Sep 2023 18:19:17 +0200 Message-ID: <20230927161934.181728-17-abologna@redhat.com> In-Reply-To: <20230927161934.181728-1-abologna@redhat.com> References: <20230927161934.181728-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1695833250155100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Andrea Bolognani Reviewed-by: Daniel P. Berrang=C3=A9 --- src/ch/meson.build | 5 +--- src/ch/virtchd.service.extra.in | 22 +++++++++++++++++ src/ch/virtchd.service.in | 44 --------------------------------- 3 files changed, 23 insertions(+), 48 deletions(-) create mode 100644 src/ch/virtchd.service.extra.in delete mode 100644 src/ch/virtchd.service.in diff --git a/src/ch/meson.build b/src/ch/meson.build index dc08069dcd..0ef7288257 100644 --- a/src/ch/meson.build +++ b/src/ch/meson.build @@ -57,11 +57,8 @@ if conf.has('WITH_CH') =20 virt_daemon_units +=3D { 'service': 'virtchd', - 'service_in': files('virtchd.service.in'), 'name': 'Libvirt ch', - 'socket_in': libvirtd_socket_in, - 'socket_ro_in': libvirtd_socket_ro_in, - 'socket_admin_in': libvirtd_socket_admin_in, + 'service_extra_in': files('virtchd.service.extra.in'), } =20 virt_install_dirs +=3D [ diff --git a/src/ch/virtchd.service.extra.in b/src/ch/virtchd.service.extra= .in new file mode 100644 index 0000000000..bc2fef57cc --- /dev/null +++ b/src/ch/virtchd.service.extra.in @@ -0,0 +1,22 @@ +[Unit] +Wants=3Dsystemd-machined.service +After=3Dsystemd-machined.service +After=3Dremote-fs.target + +[Service] +KillMode=3Dprocess +# 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=3D1024:524288 +# 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 +# 32k to support 4096 guests. +TasksMax=3D32768 +# With cgroups v2 there is no devices controller anymore, we have to use +# eBPF to control access to devices. In order to do that we create a eBPF +# hash MAP which locks memory. The default map size for 64 devices together +# with program takes 12k per guest. After rounding up we will get 64M to +# support 4096 guests. +LimitMEMLOCK=3D64M diff --git a/src/ch/virtchd.service.in b/src/ch/virtchd.service.in deleted file mode 100644 index 351eee312b..0000000000 --- a/src/ch/virtchd.service.in +++ /dev/null @@ -1,44 +0,0 @@ -[Unit] -Description=3DVirtualization Cloud-Hypervisor daemon -Conflicts=3Dlibvirtd.service -Requires=3Dvirtchd.socket -Requires=3Dvirtchd-ro.socket -Requires=3Dvirtchd-admin.socket -Wants=3Dsystemd-machined.service -After=3Dnetwork.target -After=3Ddbus.service -After=3Dapparmor.service -After=3Dremote-fs.target -After=3Dsystemd-machined.service -Documentation=3Dman:virtchd(8) -Documentation=3Dhttps://libvirt.org - -[Service] -Type=3Dnotify -Environment=3DVIRTCHD_ARGS=3D"--timeout 120" -EnvironmentFile=3D-@initconfdir@/virtchd -ExecStart=3D@sbindir@/virtchd $VIRTCHD_ARGS -ExecReload=3D/bin/kill -HUP $MAINPID -KillMode=3Dprocess -Restart=3Don-failure -# 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=3D1024:524288 -# 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 -# 32k to support 4096 guests. -TasksMax=3D32768 -# With cgroups v2 there is no devices controller anymore, we have to use -# eBPF to control access to devices. In order to do that we create a eBPF -# hash MAP which locks memory. The default map size for 64 devices togeth= er -# with program takes 12k per guest. After rounding up we will get 64M to -# support 4096 guests. -LimitMEMLOCK=3D64M - -[Install] -WantedBy=3Dmulti-user.target -Also=3Dvirtchd.socket -Also=3Dvirtchd-ro.socket -Also=3Dvirtchd-admin.socket --=20 2.41.0