summaryrefslogtreecommitdiff
path: root/libvirt.spec.in
diff options
context:
space:
mode:
authorOlaf Hering <olaf@aepfle.de>2021-12-21 12:22:43 +0100
committerAndrea Bolognani <abologna@redhat.com>2021-12-23 16:51:37 +0100
commit4ed8f5b67d2314c58837c8ff96dce311ccd4c937 (patch)
treea5e2555b44ad8de791161d228f63b6dcedf4f7cf /libvirt.spec.in
parent42cbffd715fd42824551b84aa457924340bec9e4 (diff)
downloadlibvirt-4ed8f5b67d2314c58837c8ff96dce311ccd4c937.tar.gz
spec: relocate pre script of daemon-driver-qemu
Reduce the delta in an upcoming change. No change in behavior intended. Signed-off-by: Olaf Hering <olaf@aepfle.de> Reviewed-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Diffstat (limited to 'libvirt.spec.in')
-rw-r--r--libvirt.spec.in32
1 files changed, 15 insertions, 17 deletions
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 16be1e173e..7bd74da2c9 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -1466,6 +1466,21 @@ fi
%if %{with_qemu}
+%pre daemon-driver-qemu
+# We want soft static allocation of well-known ids, as disk images
+# are commonly shared across NFS mounts by id rather than name; see
+# https://fedoraproject.org/wiki/Packaging:UsersAndGroups
+getent group kvm >/dev/null || groupadd -f -g 36 -r kvm
+getent group qemu >/dev/null || groupadd -f -g 107 -r qemu
+if ! getent passwd qemu >/dev/null; then
+ if ! getent passwd 107 >/dev/null; then
+ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu
+ else
+ useradd -r -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu
+ fi
+fi
+exit 0
+
%post daemon-driver-qemu
%if %{with_modular_daemons}
%libvirt_daemon_systemd_post virtqemud
@@ -1587,23 +1602,6 @@ done
%libvirt_daemon_perform_restart libvirtd
%libvirt_daemon_perform_restart virtnwfilterd
-%if %{with_qemu}
-%pre daemon-driver-qemu
-# We want soft static allocation of well-known ids, as disk images
-# are commonly shared across NFS mounts by id rather than name; see
-# https://fedoraproject.org/wiki/Packaging:UsersAndGroups
-getent group kvm >/dev/null || groupadd -f -g 36 -r kvm
-getent group qemu >/dev/null || groupadd -f -g 107 -r qemu
-if ! getent passwd qemu >/dev/null; then
- if ! getent passwd 107 >/dev/null; then
- useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu
- else
- useradd -r -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu
- fi
-fi
-exit 0
-%endif
-
%if %{with_lxc}
%pre login-shell
getent group virtlogin >/dev/null || groupadd -r virtlogin