]> xenbits.xensource.com Git - libvirt.git/commitdiff
systemd: Switch virtchd to common templates
authorAndrea Bolognani <abologna@redhat.com>
Tue, 19 Sep 2023 18:24:01 +0000 (20:24 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 2 Oct 2023 08:41:07 +0000 (10:41 +0200)
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/ch/meson.build
src/ch/virtchd.service.extra.in [new file with mode: 0644]
src/ch/virtchd.service.in [deleted file]

index dc08069dcd6ddbba94a0e6bbbb87473e1ffc22dd..0ef7288257e5c46026dc789af8052afa26c84588 100644 (file)
@@ -57,11 +57,8 @@ if conf.has('WITH_CH')
 
   virt_daemon_units += {
     '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'),
   }
 
   virt_install_dirs += [
diff --git a/src/ch/virtchd.service.extra.in b/src/ch/virtchd.service.extra.in
new file mode 100644 (file)
index 0000000..bc2fef5
--- /dev/null
@@ -0,0 +1,22 @@
+[Unit]
+Wants=systemd-machined.service
+After=systemd-machined.service
+After=remote-fs.target
+
+[Service]
+KillMode=process
+# Raise hard limits to match behaviour of systemd >= 240.
+# During startup, daemon will set soft limit to match hard limit
+# per systemd recommendations
+LimitNOFILE=1024: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=32768
+# 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=64M
diff --git a/src/ch/virtchd.service.in b/src/ch/virtchd.service.in
deleted file mode 100644 (file)
index 351eee3..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-[Unit]
-Description=Virtualization Cloud-Hypervisor daemon
-Conflicts=libvirtd.service
-Requires=virtchd.socket
-Requires=virtchd-ro.socket
-Requires=virtchd-admin.socket
-Wants=systemd-machined.service
-After=network.target
-After=dbus.service
-After=apparmor.service
-After=remote-fs.target
-After=systemd-machined.service
-Documentation=man:virtchd(8)
-Documentation=https://libvirt.org
-
-[Service]
-Type=notify
-Environment=VIRTCHD_ARGS="--timeout 120"
-EnvironmentFile=-@initconfdir@/virtchd
-ExecStart=@sbindir@/virtchd $VIRTCHD_ARGS
-ExecReload=/bin/kill -HUP $MAINPID
-KillMode=process
-Restart=on-failure
-# Raise hard limits to match behaviour of systemd >= 240.
-# During startup, daemon will set soft limit to match hard limit
-# per systemd recommendations
-LimitNOFILE=1024: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=32768
-# 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=64M
-
-[Install]
-WantedBy=multi-user.target
-Also=virtchd.socket
-Also=virtchd-ro.socket
-Also=virtchd-admin.socket