[libvirt PATCH 29/42] systemd: Switch virtqemud to common templates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 src/qemu/meson.build          | 33 +++++++++++++++++++++---
 src/qemu/virtqemud.service.in | 48 -----------------------------------
 2 files changed, 29 insertions(+), 52 deletions(-)
 delete mode 100644 src/qemu/virtqemud.service.in

diff --git a/src/qemu/meson.build b/src/qemu/meson.build
index b52497bdf0..7e5db09e0c 100644
--- a/src/qemu/meson.build
+++ b/src/qemu/meson.build
@@ -183,11 +183,36 @@ if conf.has('WITH_QEMU')
 
   virt_daemon_units += {
     'service': 'virtqemud',
-    'service_in': files('virtqemud.service.in'),
     'name': 'Libvirt qemu',
-    'socket_in': libvirtd_socket_in,
-    'socket_ro_in': libvirtd_socket_ro_in,
-    'socket_admin_in': libvirtd_socket_admin_in,
+    'service_unit_extra': [
+      'Requires=virtlogd.socket',
+      'Wants=virtlockd.socket',
+      'Wants=systemd-machined.service',
+      'After=systemd-machined.service',
+      'After=remote-fs.target',
+    ],
+    'service_service_extra': [
+      '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',
+    ],
+    'service_install_extra': [
+      'Also=virtlogd.socket',
+      'Also=virtlockd.socket',
+    ],
   }
 
   openrc_init_files += {
diff --git a/src/qemu/virtqemud.service.in b/src/qemu/virtqemud.service.in
deleted file mode 100644
index e79670ca95..0000000000
--- a/src/qemu/virtqemud.service.in
+++ /dev/null
@@ -1,48 +0,0 @@
-[Unit]
-Description=Virtualization qemu daemon
-Conflicts=libvirtd.service
-Requires=virtlogd.socket
-Requires=virtqemud.socket
-Requires=virtqemud-ro.socket
-Requires=virtqemud-admin.socket
-Wants=virtlockd.socket
-Wants=systemd-machined.service
-After=network.target
-After=dbus.service
-After=apparmor.service
-After=remote-fs.target
-After=systemd-machined.service
-Documentation=man:virtqemud(8)
-Documentation=https://libvirt.org
-
-[Service]
-Type=notify
-Environment=VIRTQEMUD_ARGS="--timeout 120"
-EnvironmentFile=-@initconfdir@/virtqemud
-ExecStart=@sbindir@/virtqemud $VIRTQEMUD_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=virtlogd.socket
-Also=virtlockd.socket
-Also=virtqemud.socket
-Also=virtqemud-ro.socket
-Also=virtqemud-admin.socket
-- 
2.41.0




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux