From nobody Fri Dec 19 20:31:04 2025 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 1626960371914204.43364675749842; Thu, 22 Jul 2021 06:26:11 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-576-Ep7UmVo5OMCqHWq8osvhWw-1; Thu, 22 Jul 2021 09:26:08 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D8BFB760C1; Thu, 22 Jul 2021 13:26:03 +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 A5FD35DA2D; Thu, 22 Jul 2021 13:26:03 +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 91E5F4A7C8; Thu, 22 Jul 2021 13:26:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16MDQ0YN006930 for ; Thu, 22 Jul 2021 09:26:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id B699B208DDB2; Thu, 22 Jul 2021 13:26:00 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B20D5208DDB4 for ; Thu, 22 Jul 2021 13:25:57 +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 8C5BA89C7DB for ; Thu, 22 Jul 2021 13:25:57 +0000 (UTC) Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [81.169.146.220]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-364-ING4XTGHMBiJsbJ228fnbA-1; Thu, 22 Jul 2021 09:25:54 -0400 Received: from sender by smtp.strato.de (RZmta 47.28.1 AUTH) with ESMTPSA id t06ddcx6MDPrXQF (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Thu, 22 Jul 2021 15:25:53 +0200 (CEST) X-MC-Unique: Ep7UmVo5OMCqHWq8osvhWw-1 X-MC-Unique: ING4XTGHMBiJsbJ228fnbA-1 X-RZG-AUTH: ":P2EQZWCpfu+qG7CngxMFH1J+3q8wa/QXkBR9MXjAuzpIG0mv9coXAgs0/lb0FsstkEA5gJO14iHOLFkunWFB7C1a4Y61" X-RZG-CLASS-ID: mo00 From: Olaf Hering To: libvir-list@redhat.com Subject: [PATCH v2 1/3] libvirt.spec: relocate pre script of daemon-driver-qemu Date: Thu, 22 Jul 2021 15:25:45 +0200 Message-Id: <20210722132547.3477-2-olaf@aepfle.de> In-Reply-To: <20210722132547.3477-1-olaf@aepfle.de> References: <20210722132547.3477-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.78 on 10.11.54.4 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.14 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: 1626960373989100001 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 cb48dd0be0..85e79883c5 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1417,23 +1417,6 @@ fi rm -rf %{_localstatedir}/lib/rpm-state/libvirt || : =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 -%endif - %if %{with_lxc} %pre login-shell getent group virtlogin >/dev/null || groupadd -r virtlogin @@ -1688,6 +1671,21 @@ exit 0 %endif =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 + %files daemon-driver-qemu %config(noreplace) %{_sysconfdir}/sysconfig/virtqemud %config(noreplace) %{_sysconfdir}/libvirt/virtqemud.conf