From nobody Sun May 5 17:59:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1558956964; cv=none; d=zoho.com; s=zohoarc; b=eUKky9UsENh9ULMsYzAH1SltdhVXB3fpCwOuNdJCgiK0Z+MAp+4oZU/77wDR5MRhR4/wCGXeMNiYkQOgUngeAPvtQYMYL9SMHRfnG023AsV8ntocvInH/Bvnz8hnPglA5jpfqyNFKgs76POSLl6hGmQQ9FV+d9MvqstTcID9CF4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558956964; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=gsrjA4LtOXWD0sP+30hij3qymDtyUp4iXm8F4sJd7FQ=; b=gBCRTAazIe2njuyK0vk2qp4DFss0Oie5d37Y1EO0DX/sP3WA2toRBcsghxjmI1hp9+GFWbyRAYRgyCTqHnNCfToRZyd0mb2ua9YYofzEUtRHnqcFQ7pvrLXXVbp58zoLvL2vNsrUCOeTG2fMzQTu0DwVWFpQtLQjCnJWtNE0NYM= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1558956964136887.519858705927; Mon, 27 May 2019 04:36:04 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2A760C045770; Mon, 27 May 2019 11:36:01 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 30B892AA85; Mon, 27 May 2019 11:35:59 +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 BC2441806B0F; Mon, 27 May 2019 11:35:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x4RBYeVc024016 for ; Mon, 27 May 2019 07:34:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2C2521001E71; Mon, 27 May 2019 11:34:40 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9F3BE1001E60 for ; Mon, 27 May 2019 11:34:33 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Mon, 27 May 2019 13:34:31 +0200 Message-Id: <20190527113431.31208-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] spec: Improve handling for default network 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 27 May 2019 11:36:02 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This is exactly how we already treat nwfilters, which require the same kind of care (aka nasty hacks) as the default network, because in both cases the UUID is generated and written to disk the first time libvirtd is started after installing the corresponding subpackage. After this patch, RPM will be aware of the fact that the libvirt-daemon-config-network subpackage owns the default network. Signed-off-by: Andrea Bolognani --- libvirt.spec.in | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index b159c50d8f..94691c38fb 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1250,8 +1250,8 @@ install -d -m 0755 $RPM_BUILD_ROOT%{_datadir}/lib/lib= virt/dnsmasq/ install -d -m 0755 $RPM_BUILD_ROOT%{_datadir}/libvirt/networks/ cp $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/default.xml \ $RPM_BUILD_ROOT%{_datadir}/libvirt/networks/default.xml -rm -f $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/default.xml -rm -f $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/autostart/defaul= t.xml +# libvirt saves this file with mode 0600 +chmod 0600 $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/default.xml =20 # nwfilter files are installed in /usr/share/libvirt and copied to /etc in= %post # to avoid verification errors on changed files in /etc @@ -1427,6 +1427,8 @@ if test $1 -eq 1 && test ! -f %{_sysconfdir}/libvirt/= qemu/networks/default.xml ; < %{_datadir}/libvirt/networks/default.xml \ > %{_sysconfdir}/libvirt/qemu/networks/default.xml ln -s ../default.xml %{_sysconfdir}/libvirt/qemu/networks/autostart/de= fault.xml + # libvirt saves this file with mode 0600 + chmod 0600 %{_sysconfdir}/libvirt/qemu/networks/default.xml =20 # Make sure libvirt picks up the new network defininiton mkdir -p %{_localstatedir}/lib/rpm-state/libvirt || : @@ -1577,6 +1579,8 @@ exit 0 %files daemon-config-network %dir %{_datadir}/libvirt/networks/ %{_datadir}/libvirt/networks/default.xml +%ghost %{_sysconfdir}/libvirt/qemu/networks/default.xml +%ghost %{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml =20 %files daemon-config-nwfilter %dir %{_datadir}/libvirt/nwfilter/ --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list