From nobody Mon Feb 9 13:57:32 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; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com 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 1639667682166980.535910829838; Thu, 16 Dec 2021 07:14:42 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-574-U08pyGIJNgSTzdfztjkDVw-1; Thu, 16 Dec 2021 10:14:36 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A70B981CCCD; Thu, 16 Dec 2021 15:14:31 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8801077D52; Thu, 16 Dec 2021 15:14:31 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 283E84CA9B; Thu, 16 Dec 2021 15:14:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1BGFESsQ001555 for ; Thu, 16 Dec 2021 10:14:28 -0500 Received: by smtp.corp.redhat.com (Postfix) id E2969C23DD4; Thu, 16 Dec 2021 15:14:27 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast08.extmail.prod.ext.rdu2.redhat.com [10.11.55.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DDF10C23DD3 for ; Thu, 16 Dec 2021 15:14:27 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (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 C69843932D2A for ; Thu, 16 Dec 2021 15:14:27 +0000 (UTC) Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [85.215.255.21]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-556-br7ByvQvOm-BxzMp_ts8DA-1; Thu, 16 Dec 2021 10:14:23 -0500 Received: from sender by smtp.strato.de (RZmta 47.35.3 AUTH) with ESMTPSA id z0a241xBGFEMEhh (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Thu, 16 Dec 2021 16:14:22 +0100 (CET) X-MC-Unique: U08pyGIJNgSTzdfztjkDVw-1 X-MC-Unique: br7ByvQvOm-BxzMp_ts8DA-1 X-RZG-AUTH: ":P2EQZWCpfu+qG7CngxMFH1J+3q8wa/QXkBR9MXjAuzpIG0mv9coXAgti9Fb4R8steKZCrR0HY7v4QcuE0r9pubWIEA8T" X-RZG-CLASS-ID: mo00 From: Olaf Hering To: libvir-list@redhat.com Subject: [PATCH v5 1/3] libvirt.spec: relocate pre script of daemon-driver-qemu Date: Thu, 16 Dec 2021 16:14:17 +0100 Message-Id: <20211216151419.30510-2-olaf@aepfle.de> In-Reply-To: <20211216151419.30510-1-olaf@aepfle.de> References: <20211216151419.30510-1-olaf@aepfle.de> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-loop: libvir-list@redhat.com Cc: Olaf Hering X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1639667683223100002 Content-Type: text/plain; charset="utf-8" Reduce the delta in an upcoming change. No change in behavior intended. Signed-off-by: Olaf Hering --- libvirt.spec.in | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index f6c705564a..4675e67d15 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1466,6 +1466,21 @@ fi =20 =20 %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 =20 -%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