[libvirt PATCH 2/2] spec: Drop UUID handling for default network

Andrea Bolognani posted 2 patches 5 years, 2 months ago
There is a newer version of this series
[libvirt PATCH 2/2] spec: Drop UUID handling for default network
Posted by Andrea Bolognani 5 years, 2 months ago
We're no longer generating a UUID during installation, so we
clearly don't need to strip it afterwards; and since the network
driver is perfectly capable of generating a UUID if necessary, we
don't need to do that at %post time either.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
 libvirt.spec.in | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/libvirt.spec.in b/libvirt.spec.in
index 034982809d..f4cee8940d 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -1240,8 +1240,6 @@ cp -a $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/nwfilter/*.xml \
 # libvirt saves these files with mode 600
 chmod 600 $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/nwfilter/*.xml
 
-# Strip auto-generated UUID - we need it generated per-install
-sed -i -e "/<uuid>/d" $RPM_BUILD_ROOT%{_datadir}/libvirt/networks/default.xml
 %if ! %{with_qemu}
 rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_qemu.aug
 rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_qemu.aug
@@ -1422,9 +1420,7 @@ if test $1 -eq 1 && test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml ;
         ;;
     esac
 
-    UUID=`/usr/bin/uuidgen`
     sed -e "s/${orig_sub}/${sub}/g" \
-        -e "s,</name>,</name>\n  <uuid>$UUID</uuid>," \
          < %{_datadir}/libvirt/networks/default.xml \
          > %{_sysconfdir}/libvirt/qemu/networks/default.xml
     ln -s ../default.xml %{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml
-- 
2.26.2

Re: [libvirt PATCH 2/2] spec: Drop UUID handling for default network
Posted by Neal Gompa 5 years, 2 months ago
On Sun, Nov 15, 2020 at 3:43 PM Andrea Bolognani <abologna@redhat.com> wrote:
>
> We're no longer generating a UUID during installation, so we
> clearly don't need to strip it afterwards; and since the network
> driver is perfectly capable of generating a UUID if necessary, we
> don't need to do that at %post time either.
>
> Signed-off-by: Andrea Bolognani <abologna@redhat.com>
> ---
>  libvirt.spec.in | 4 ----
>  1 file changed, 4 deletions(-)
>
> diff --git a/libvirt.spec.in b/libvirt.spec.in
> index 034982809d..f4cee8940d 100644
> --- a/libvirt.spec.in
> +++ b/libvirt.spec.in
> @@ -1240,8 +1240,6 @@ cp -a $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/nwfilter/*.xml \
>  # libvirt saves these files with mode 600
>  chmod 600 $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/nwfilter/*.xml
>
> -# Strip auto-generated UUID - we need it generated per-install
> -sed -i -e "/<uuid>/d" $RPM_BUILD_ROOT%{_datadir}/libvirt/networks/default.xml
>  %if ! %{with_qemu}
>  rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_qemu.aug
>  rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_qemu.aug
> @@ -1422,9 +1420,7 @@ if test $1 -eq 1 && test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml ;
>          ;;
>      esac
>
> -    UUID=`/usr/bin/uuidgen`
>      sed -e "s/${orig_sub}/${sub}/g" \
> -        -e "s,</name>,</name>\n  <uuid>$UUID</uuid>," \
>           < %{_datadir}/libvirt/networks/default.xml \
>           > %{_sysconfdir}/libvirt/qemu/networks/default.xml
>      ln -s ../default.xml %{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml
> --
> 2.26.2
>

Looks good to me, though when did we make this change?

Regardless...

Reviewed-by: Neal Gompa <ngompa13@gmail.com>



--
真実はいつも一つ!/ Always, there's only one truth!


Re: [libvirt PATCH 2/2] spec: Drop UUID handling for default network
Posted by Andrea Bolognani 5 years, 2 months ago
On Tue, 2020-11-17 at 13:01 -0500, Neal Gompa wrote:
> On Sun, Nov 15, 2020 at 3:43 PM Andrea Bolognani <abologna@redhat.com> wrote:
> > -    UUID=`/usr/bin/uuidgen`
> >      sed -e "s/${orig_sub}/${sub}/g" \
> > -        -e "s,</name>,</name>\n  <uuid>$UUID</uuid>," \
> >           < %{_datadir}/libvirt/networks/default.xml \
> >           > %{_sysconfdir}/libvirt/qemu/networks/default.xml
> >      ln -s ../default.xml %{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml
> 
> Looks good to me, though when did we make this change?

In the first patch of the series ;)

-- 
Andrea Bolognani / Red Hat / Virtualization

Re: [libvirt PATCH 2/2] spec: Drop UUID handling for default network
Posted by Neal Gompa 5 years, 2 months ago
On Tue, Nov 17, 2020 at 2:29 PM Andrea Bolognani <abologna@redhat.com> wrote:
>
> On Tue, 2020-11-17 at 13:01 -0500, Neal Gompa wrote:
> > On Sun, Nov 15, 2020 at 3:43 PM Andrea Bolognani <abologna@redhat.com> wrote:
> > > -    UUID=`/usr/bin/uuidgen`
> > >      sed -e "s/${orig_sub}/${sub}/g" \
> > > -        -e "s,</name>,</name>\n  <uuid>$UUID</uuid>," \
> > >           < %{_datadir}/libvirt/networks/default.xml \
> > >           > %{_sysconfdir}/libvirt/qemu/networks/default.xml
> > >      ln -s ../default.xml %{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml
> >
> > Looks good to me, though when did we make this change?
>
> In the first patch of the series ;)
>

D'oh! This is why email patch review is hit-or-miss... :/


-- 
真実はいつも一つ!/ Always, there's only one truth!