From db81eba56f3535af59d7d803c11c3e5c84c4bc3ff98ad7c5b623089c7dbd3307 Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Tue, 21 Jan 2014 00:43:47 +0000 Subject: [PATCH] - Following the upstream pattern, introduce the daemon-config-network subpackage to handle defining the default network bnc#859041 OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=343 --- libvirt.changes | 8 ++++++++ libvirt.spec | 40 ++++++++++++++++++++++++++++++---------- 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/libvirt.changes b/libvirt.changes index 36667d9..ff52f82 100644 --- a/libvirt.changes +++ b/libvirt.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Mon Jan 20 17:40:10 MST 2014 - jfehlig@suse.com + +- Following the upstream pattern, introduce the + daemon-config-network subpackage to handle defining the default + network + bnc#859041 + ------------------------------------------------------------------- Fri Jan 17 12:30:48 MST 2014 - jfehlig@suse.com diff --git a/libvirt.spec b/libvirt.spec index 769439e..e7ac02f 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -241,6 +241,9 @@ Group: Development/Libraries/C and C++ %if %{with_libvirtd} Requires: libvirt-daemon = %{version}-%{release} +%if %{with_network} +Requires: libvirt-daemon-config-network = %{version}-%{release} +%endif %if %{with_nwfilter} Requires: libvirt-daemon-config-nwfilter = %{version}-%{release} %endif @@ -513,6 +516,17 @@ Server side daemon required to manage the virtualization capabilities of recent versions of Linux. Requires a hypervisor specific sub-RPM for specific drivers. +%if %{with_network} +%package daemon-config-network +Summary: Default configuration files for the libvirtd daemon +Group: Development/Libraries + +Requires: libvirt-daemon = %{version}-%{release} + +%description daemon-config-network +Default configuration files for setting up NAT based networking +%endif + %if %{with_nwfilter} %package daemon-config-nwfilter @@ -1291,16 +1305,6 @@ fi %post daemon /sbin/ldconfig -%if %{with_network} -# Install the default network if one doesn't exist -if test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml -then - UUID=`/usr/bin/uuidgen` - sed -e "s,,\n $UUID," \ - < %{_datadir}/libvirt/networks/default.xml \ - > %{_sysconfdir}/libvirt/qemu/networks/default.xml -fi -%endif %if %{with_systemd} %service_add_post libvirtd.service %service_add_post virtlockd.service virtlockd.socket @@ -1329,6 +1333,17 @@ fi %restart_on_update libvirtd %restart_on_update virtlockd %insserv_cleanup + +%if %{with_network} +%post daemon-config-network +# Install the default network if one doesn't exist +if test $1 -eq 1 && test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml ; then + UUID=`/usr/bin/uuidgen` + sed -e "s,,\n $UUID," \ + < %{_datadir}/libvirt/networks/default.xml \ + > %{_sysconfdir}/libvirt/qemu/networks/default.xml +fi + %endif %endif # with_libvirtd %post client @@ -1468,6 +1483,11 @@ fi %endif %endif # ! %{with_driver_modules} +%if %{with_network} +%files daemon-config-network +%defattr(-, root, root) +%endif + %if %{with_nwfilter} %files daemon-config-nwfilter