[libvirt] [PATCH 0/6] Various spec file enhancements

This series moves some driver-specific files from the main libvirt-daemon package to the respective libvirt-daemon-driver-* package when building with driver modules. This was originally all one patch that I found difficult to review, so I tried to logically break it up in hopes to make it easier to review. Jim Fehlig (6): spec: Conditionally add /etc/libvirt/nwfilter spec: Only add libvirt-daemon pre install script if building with qemu spec: Fix files list when building without driver modules spec: Conditionally specify some hypervisor-specific files spec: Define hypervisor-specific files together spec: move driver-specific files to driver subpackages libvirt.spec.in | 199 +++++++++++++++++++++++++++++++++----------------------- 1 file changed, 117 insertions(+), 82 deletions(-) -- 1.8.0.1

Only add /etc/libvirt/nwfilter to the libvirt-daemon files list if building with nwfilter support. --- libvirt.spec.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libvirt.spec.in b/libvirt.spec.in index eff7103..7f2a23a 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1752,7 +1752,9 @@ exit 0 %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/autostart %endif + %if %{with_nwfilter} %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/nwfilter/ + %endif %if %{with_systemd} %{_unitdir}/libvirtd.service -- 1.8.0.1

On 06.12.2013 00:36, Jim Fehlig wrote:
Only add /etc/libvirt/nwfilter to the libvirt-daemon files list if building with nwfilter support. --- libvirt.spec.in | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/libvirt.spec.in b/libvirt.spec.in index eff7103..7f2a23a 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1752,7 +1752,9 @@ exit 0 %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/autostart %endif
+ %if %{with_nwfilter} %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/nwfilter/ + %endif
%if %{with_systemd} %{_unitdir}/libvirtd.service
Not only that but this one is worth fixing too: diff --git a/libvirt.spec.in b/libvirt.spec.in index 7f2a23a..c14d343 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -390,6 +390,7 @@ Requires: libvirt-daemon-config-network = %{version}-%{release} %endif %if %{with_nwfilter} Requires: libvirt-daemon-config-nwfilter = %{version}-%{release} +Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release} %endif %if %{with_driver_modules} %if %{with_libxl} @@ -416,7 +417,6 @@ Requires: libvirt-daemon-driver-secret = %{version}-%{release} Requires: libvirt-daemon-driver-storage = %{version}-%{release} Requires: libvirt-daemon-driver-network = %{version}-%{release} Requires: libvirt-daemon-driver-nodedev = %{version}-%{release} -Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release} %endif %endif Requires: libvirt-client = %{version}-%{release} But you can save that for a separate patch if you want to. Michal

Michal Privoznik wrote:
On 06.12.2013 00:36, Jim Fehlig wrote:
Only add /etc/libvirt/nwfilter to the libvirt-daemon files list if building with nwfilter support. --- libvirt.spec.in | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/libvirt.spec.in b/libvirt.spec.in index eff7103..7f2a23a 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1752,7 +1752,9 @@ exit 0 %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/autostart %endif
+ %if %{with_nwfilter} %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/nwfilter/ + %endif
%if %{with_systemd} %{_unitdir}/libvirtd.service
Not only that but this one is worth fixing too:
diff --git a/libvirt.spec.in b/libvirt.spec.in index 7f2a23a..c14d343 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -390,6 +390,7 @@ Requires: libvirt-daemon-config-network = %{version}-%{release} %endif %if %{with_nwfilter} Requires: libvirt-daemon-config-nwfilter = %{version}-%{release} +Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release} %endif %if %{with_driver_modules} %if %{with_libxl} @@ -416,7 +417,6 @@ Requires: libvirt-daemon-driver-secret = %{version}-%{release} Requires: libvirt-daemon-driver-storage = %{version}-%{release} Requires: libvirt-daemon-driver-network = %{version}-%{release} Requires: libvirt-daemon-driver-nodedev = %{version}-%{release} -Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release} %endif %endif Requires: libvirt-client = %{version}-%{release}
libvirt-daemon-driver-nwfilter is only built when with_driver_modules is defined, so I'll need to wrap this in a with_nwfilter within with_driver_modules. Is it ok if I squash in the following? Regards, Jim diff --git a/libvirt.spec.in b/libvirt.spec.in index 7f2a23a..2d10196 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -410,13 +410,15 @@ Requires: libvirt-daemon-driver-xen = %{version}-%{release} %if %{with_vbox} Requires: libvirt-daemon-driver-vbox = %{version}-%{release} %endif + %if %{with_nwfilter} +Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release} + %endif Requires: libvirt-daemon-driver-interface = %{version}-%{release} Requires: libvirt-daemon-driver-secret = %{version}-%{release} Requires: libvirt-daemon-driver-storage = %{version}-%{release} Requires: libvirt-daemon-driver-network = %{version}-%{release} Requires: libvirt-daemon-driver-nodedev = %{version}-%{release} -Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release} %endif %endif Requires: libvirt-client = %{version}-%{release}

Jim Fehlig wrote:
Michal Privoznik wrote:
On 06.12.2013 00:36, Jim Fehlig wrote:
Only add /etc/libvirt/nwfilter to the libvirt-daemon files list if building with nwfilter support. --- libvirt.spec.in | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/libvirt.spec.in b/libvirt.spec.in index eff7103..7f2a23a 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1752,7 +1752,9 @@ exit 0 %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/autostart %endif
+ %if %{with_nwfilter} %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/nwfilter/ + %endif
%if %{with_systemd} %{_unitdir}/libvirtd.service
Not only that but this one is worth fixing too:
diff --git a/libvirt.spec.in b/libvirt.spec.in index 7f2a23a..c14d343 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -390,6 +390,7 @@ Requires: libvirt-daemon-config-network = %{version}-%{release} %endif %if %{with_nwfilter} Requires: libvirt-daemon-config-nwfilter = %{version}-%{release} +Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release} %endif %if %{with_driver_modules} %if %{with_libxl} @@ -416,7 +417,6 @@ Requires: libvirt-daemon-driver-secret = %{version}-%{release} Requires: libvirt-daemon-driver-storage = %{version}-%{release} Requires: libvirt-daemon-driver-network = %{version}-%{release} Requires: libvirt-daemon-driver-nodedev = %{version}-%{release} -Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release} %endif %endif Requires: libvirt-client = %{version}-%{release}
libvirt-daemon-driver-nwfilter is only built when with_driver_modules is defined, so I'll need to wrap this in a with_nwfilter within with_driver_modules. Is it ok if I squash in the following?
I modified commit message to reflect this change. Updated patch attached. Regards, Jim

On 12/06/2013 10:19 AM, Jim Fehlig wrote:
I modified commit message to reflect this change. Updated patch attached.
ACK to the updated version. Thanks for tackling this series. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

The %pre script in libvirt-daemon is specific to qemu, so only include it if building with qemu support. --- libvirt.spec.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 7f2a23a..1306322 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1522,8 +1522,9 @@ then fi %if %{with_libvirtd} + %if %{with_qemu} %pre daemon - %if 0%{?fedora} >= 12 || 0%{?rhel} >= 6 + %if 0%{?fedora} >= 12 || 0%{?rhel} >= 6 # 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 @@ -1537,6 +1538,7 @@ if ! getent passwd qemu >/dev/null; then fi fi exit 0 + %endif %endif %post daemon -- 1.8.0.1

The daemon-config-{network,nwfilter} subpackages are built regardless of whether or not with_driver_modules is defined, therefore don't conditionally define their files list. --- libvirt.spec.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 1306322..4938a0d 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1888,18 +1888,18 @@ exit 0 %{_mandir}/man8/libvirtd.8* %{_mandir}/man8/virtlockd.8* - %if %{with_driver_modules} - %if %{with_network} + %if %{with_network} %files daemon-config-network %defattr(-, root, root) - %endif + %endif - %if %{with_nwfilter} + %if %{with_nwfilter} %files daemon-config-nwfilter %defattr(-, root, root) %{_sysconfdir}/libvirt/nwfilter/*.xml - %endif + %endif + %if %{with_driver_modules} %if %{with_interface} %files daemon-driver-interface %defattr(-, root, root) -- 1.8.0.1

Move some hypervisor-specific files in the libvirt-daemon subpackage within conditionals for those hypervisors. --- libvirt.spec.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 4938a0d..f025363 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1774,9 +1774,6 @@ exit 0 %if 0%{?fedora} >= 14 || 0%{?rhel} >= 6 %config(noreplace) %{_prefix}/lib/sysctl.d/libvirtd.conf %endif -%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/qemu/ -%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/lxc/ -%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/uml/ %if %{with_libxl} %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/libxl/ %endif @@ -1786,13 +1783,16 @@ exit 0 %config(noreplace) %{_sysconfdir}/libvirt/qemu.conf %config(noreplace) %{_sysconfdir}/libvirt/qemu-lockd.conf %config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.qemu +%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/qemu/ %endif %if %{with_lxc} %config(noreplace) %{_sysconfdir}/libvirt/lxc.conf %config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.lxc +%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/lxc/ %endif %if %{with_uml} %config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.uml +%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/uml/ %endif %dir %{_datadir}/libvirt/ -- 1.8.0.1

Collapse the various {with_<hypervisor>} conditionals in the libvirt-daemon package files section into a single {with_<hypervisor>} conditional --- libvirt.spec.in | 126 +++++++++++++++++++++++--------------------------------- 1 file changed, 51 insertions(+), 75 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index f025363..bd5c883 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1748,12 +1748,6 @@ exit 0 %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/ - %if %{with_network} -%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/ -%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/ -%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/autostart - %endif - %if %{with_nwfilter} %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/nwfilter/ %endif @@ -1774,34 +1768,10 @@ exit 0 %if 0%{?fedora} >= 14 || 0%{?rhel} >= 6 %config(noreplace) %{_prefix}/lib/sysctl.d/libvirtd.conf %endif - %if %{with_libxl} -%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/libxl/ - %endif %config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd - %if %{with_qemu} -%config(noreplace) %{_sysconfdir}/libvirt/qemu.conf -%config(noreplace) %{_sysconfdir}/libvirt/qemu-lockd.conf -%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.qemu -%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/qemu/ - %endif - %if %{with_lxc} -%config(noreplace) %{_sysconfdir}/libvirt/lxc.conf -%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.lxc -%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/lxc/ - %endif - %if %{with_uml} -%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.uml -%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/uml/ - %endif - %dir %{_datadir}/libvirt/ - %if %{with_network} -%dir %{_datadir}/libvirt/networks/ -%{_datadir}/libvirt/networks/default.xml - %endif - %ghost %dir %{_localstatedir}/run/libvirt/ %dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/images/ @@ -1809,47 +1779,10 @@ exit 0 %dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/boot/ %dir %attr(0711, root, root) %{_localstatedir}/cache/libvirt/ - %if %{with_qemu} -%ghost %dir %attr(0700, root, root) %{_localstatedir}/run/libvirt/qemu/ -%dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/ -%dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/channel/ -%dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/channel/target/ -%dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/cache/libvirt/qemu/ - %endif - %if %{with_lxc} -%ghost %dir %{_localstatedir}/run/libvirt/lxc/ -%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/lxc/ - %endif - %if %{with_uml} -%ghost %dir %{_localstatedir}/run/libvirt/uml/ -%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/uml/ - %endif - %if %{with_libxl} -%ghost %dir %{_localstatedir}/run/libvirt/libxl/ -%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/libxl/ - %endif - %if %{with_xen} -%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/xen/ - %endif - %if %{with_network} -%ghost %dir %{_localstatedir}/run/libvirt/network/ -%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/network/ -%dir %attr(0755, root, root) %{_localstatedir}/lib/libvirt/dnsmasq/ - %endif %dir %attr(0755, root, root) %{_libdir}/libvirt/lock-driver %attr(0755, root, root) %{_libdir}/libvirt/lock-driver/lockd.so - %if %{with_qemu} -%{_datadir}/augeas/lenses/libvirtd_qemu.aug -%{_datadir}/augeas/lenses/tests/test_libvirtd_qemu.aug - %endif - - %if %{with_lxc} -%{_datadir}/augeas/lenses/libvirtd_lxc.aug -%{_datadir}/augeas/lenses/tests/test_libvirtd_lxc.aug - %endif - %{_datadir}/augeas/lenses/libvirtd.aug %{_datadir}/augeas/lenses/tests/test_libvirtd.aug %{_datadir}/augeas/lenses/virtlockd.aug @@ -1868,14 +1801,6 @@ exit 0 %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/ - %if %{with_lxc} -%attr(0755, root, root) %{_libexecdir}/libvirt_lxc - %endif - - %if %{with_storage_disk} -%attr(0755, root, root) %{_libexecdir}/libvirt_parthelper - %endif - %attr(0755, root, root) %{_libexecdir}/libvirt_iohelper %if %{with_apparmor} @@ -1889,6 +1814,57 @@ exit 0 %{_mandir}/man8/virtlockd.8* %if %{with_network} +%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/ +%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/ +%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/autostart +%dir %{_datadir}/libvirt/networks/ +%{_datadir}/libvirt/networks/default.xml +%ghost %dir %{_localstatedir}/run/libvirt/network/ +%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/network/ +%dir %attr(0755, root, root) %{_localstatedir}/lib/libvirt/dnsmasq/ + %endif + %if %{with_storage_disk} +%attr(0755, root, root) %{_libexecdir}/libvirt_parthelper + %endif + %if %{with_qemu} +%config(noreplace) %{_sysconfdir}/libvirt/qemu.conf +%config(noreplace) %{_sysconfdir}/libvirt/qemu-lockd.conf +%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.qemu +%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/qemu/ +%ghost %dir %attr(0700, root, root) %{_localstatedir}/run/libvirt/qemu/ +%dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/ +%dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/channel/ +%dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/channel/target/ +%dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/cache/libvirt/qemu/ +%{_datadir}/augeas/lenses/libvirtd_qemu.aug +%{_datadir}/augeas/lenses/tests/test_libvirtd_qemu.aug + %endif + %if %{with_lxc} +%config(noreplace) %{_sysconfdir}/libvirt/lxc.conf +%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.lxc +%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/lxc/ +%ghost %dir %{_localstatedir}/run/libvirt/lxc/ +%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/lxc/ +%{_datadir}/augeas/lenses/libvirtd_lxc.aug +%{_datadir}/augeas/lenses/tests/test_libvirtd_lxc.aug +%attr(0755, root, root) %{_libexecdir}/libvirt_lxc + %endif + %if %{with_uml} +%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.uml +%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/uml/ +%ghost %dir %{_localstatedir}/run/libvirt/uml/ +%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/uml/ + %endif + %if %{with_libxl} +%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/libxl/ +%ghost %dir %{_localstatedir}/run/libvirt/libxl/ +%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/libxl/ + %endif + %if %{with_xen} +%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/xen/ + %endif + + %if %{with_network} %files daemon-config-network %defattr(-, root, root) %endif -- 1.8.0.1

The libvirt-daemon package contains several driver-specific files, directories, and script, which can be problematic when building the package with multiple hypervisor support, e.g. both QEMU and Xen. E.g. installing a QEMU+Xen enabled libvirt-daemon on a Xen-only system will result in the creation of qemu and kvm groups and a qemu user. Move the driver-specific files, directories, and script to the respective driver subpackages. --- libvirt.spec.in | 91 +++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 73 insertions(+), 18 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index bd5c883..32878f9 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1522,9 +1522,10 @@ then fi %if %{with_libvirtd} - %if %{with_qemu} + %if ! %{with_driver_modules} + %if %{with_qemu} %pre daemon - %if 0%{?fedora} >= 12 || 0%{?rhel} >= 6 + %if 0%{?fedora} >= 12 || 0%{?rhel} >= 6 # 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 @@ -1538,6 +1539,7 @@ if ! getent passwd qemu >/dev/null; then fi fi exit 0 + %endif %endif %endif @@ -1671,6 +1673,27 @@ fi /sbin/chkconfig --del libvirtd >/dev/null 2>&1 || : /bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 || : %endif + + %if %{with_driver_modules} + %if %{with_qemu} +%pre daemon-driver-qemu + %if 0%{?fedora} >= 12 || 0%{?rhel} >= 6 +# 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 + %endif + %endif %endif # %{with_libvirtd} %preun client @@ -1813,7 +1836,8 @@ exit 0 %{_mandir}/man8/libvirtd.8* %{_mandir}/man8/virtlockd.8* - %if %{with_network} + %if ! %{with_driver_modules} + %if %{with_network} %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/ %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/ %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/autostart @@ -1822,11 +1846,11 @@ exit 0 %ghost %dir %{_localstatedir}/run/libvirt/network/ %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/network/ %dir %attr(0755, root, root) %{_localstatedir}/lib/libvirt/dnsmasq/ - %endif - %if %{with_storage_disk} + %endif + %if %{with_storage_disk} %attr(0755, root, root) %{_libexecdir}/libvirt_parthelper - %endif - %if %{with_qemu} + %endif + %if %{with_qemu} %config(noreplace) %{_sysconfdir}/libvirt/qemu.conf %config(noreplace) %{_sysconfdir}/libvirt/qemu-lockd.conf %config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.qemu @@ -1838,8 +1862,8 @@ exit 0 %dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/cache/libvirt/qemu/ %{_datadir}/augeas/lenses/libvirtd_qemu.aug %{_datadir}/augeas/lenses/tests/test_libvirtd_qemu.aug - %endif - %if %{with_lxc} + %endif + %if %{with_lxc} %config(noreplace) %{_sysconfdir}/libvirt/lxc.conf %config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.lxc %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/lxc/ @@ -1848,21 +1872,22 @@ exit 0 %{_datadir}/augeas/lenses/libvirtd_lxc.aug %{_datadir}/augeas/lenses/tests/test_libvirtd_lxc.aug %attr(0755, root, root) %{_libexecdir}/libvirt_lxc - %endif - %if %{with_uml} + %endif + %if %{with_uml} %config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.uml %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/uml/ %ghost %dir %{_localstatedir}/run/libvirt/uml/ %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/uml/ - %endif - %if %{with_libxl} + %endif + %if %{with_libxl} %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/libxl/ %ghost %dir %{_localstatedir}/run/libvirt/libxl/ %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/libxl/ - %endif - %if %{with_xen} + %endif + %if %{with_xen} %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/xen/ - %endif + %endif + %endif # ! %{with_driver_modules} %if %{with_network} %files daemon-config-network @@ -1907,36 +1932,66 @@ exit 0 %if %{with_storage} %files daemon-driver-storage %defattr(-, root, root) + %if %{with_storage_disk} +%attr(0755, root, root) %{_libexecdir}/libvirt_parthelper + %endif %{_libdir}/%{name}/connection-driver/libvirt_driver_storage.so %endif %if %{with_qemu} %files daemon-driver-qemu %defattr(-, root, root) -%{_libdir}/%{name}/connection-driver/libvirt_driver_qemu.so +%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/qemu/ +%config(noreplace) %{_sysconfdir}/libvirt/qemu.conf +%config(noreplace) %{_sysconfdir}/libvirt/qemu-lockd.conf +%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.qemu +%ghost %dir %attr(0700, root, root) %{_localstatedir}/run/libvirt/qemu/ +%dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/ +%dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/channel/ +%dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/channel/target/ +%dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/cache/libvirt/qemu/ +%{_datadir}/augeas/lenses/libvirtd_qemu.aug +%{_datadir}/augeas/lenses/tests/test_libvirtd_qemu.aug +{_libdir}/%{name}/connection-driver/libvirt_driver_qemu.so %endif %if %{with_lxc} %files daemon-driver-lxc %defattr(-, root, root) +%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/lxc/ +%config(noreplace) %{_sysconfdir}/libvirt/lxc.conf +%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.lxc +%ghost %dir %{_localstatedir}/run/libvirt/lxc/ +%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/lxc/ +%{_datadir}/augeas/lenses/libvirtd_lxc.aug +%{_datadir}/augeas/lenses/tests/test_libvirtd_lxc.aug +%attr(0755, root, root) %{_libexecdir}/libvirt_lxc %{_libdir}/%{name}/connection-driver/libvirt_driver_lxc.so %endif %if %{with_uml} %files daemon-driver-uml %defattr(-, root, root) -%{_libdir}/%{name}/connection-driver/libvirt_driver_uml.so +%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/uml/ +%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.uml +%ghost %dir %{_localstatedir}/run/libvirt/uml/ +%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/uml/ +{_libdir}/%{name}/connection-driver/libvirt_driver_uml.so %endif %if %{with_xen} %files daemon-driver-xen %defattr(-, root, root) +%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/xen/ %{_libdir}/%{name}/connection-driver/libvirt_driver_xen.so %endif %if %{with_libxl} %files daemon-driver-libxl %defattr(-, root, root) +%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/libxl/ +%ghost %dir %{_localstatedir}/run/libvirt/libxl/ +%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/libxl/ %{_libdir}/%{name}/connection-driver/libvirt_driver_libxl.so %endif -- 1.8.0.1

On 06.12.2013 00:36, Jim Fehlig wrote:
This series moves some driver-specific files from the main libvirt-daemon package to the respective libvirt-daemon-driver-* package when building with driver modules.
This was originally all one patch that I found difficult to review, so I tried to logically break it up in hopes to make it easier to review.
Jim Fehlig (6): spec: Conditionally add /etc/libvirt/nwfilter spec: Only add libvirt-daemon pre install script if building with qemu spec: Fix files list when building without driver modules spec: Conditionally specify some hypervisor-specific files spec: Define hypervisor-specific files together spec: move driver-specific files to driver subpackages
libvirt.spec.in | 199 +++++++++++++++++++++++++++++++++----------------------- 1 file changed, 117 insertions(+), 82 deletions(-)
ACK series but see my comment to 1/6. Michal

Michal Privoznik wrote:
On 06.12.2013 00:36, Jim Fehlig wrote:
This series moves some driver-specific files from the main libvirt-daemon package to the respective libvirt-daemon-driver-* package when building with driver modules.
This was originally all one patch that I found difficult to review, so I tried to logically break it up in hopes to make it easier to review.
Jim Fehlig (6): spec: Conditionally add /etc/libvirt/nwfilter spec: Only add libvirt-daemon pre install script if building with qemu spec: Fix files list when building without driver modules spec: Conditionally specify some hypervisor-specific files spec: Define hypervisor-specific files together spec: move driver-specific files to driver subpackages
libvirt.spec.in | 199 +++++++++++++++++++++++++++++++++----------------------- 1 file changed, 117 insertions(+), 82 deletions(-)
ACK series but see my comment to 1/6.
Yep, saw that and reposted the patch, which Eric ACK'ed. I've tested full, client-only, and without modules builds on my SUSE-ized version of the spec file after applying this series. I didn't notice any problems, but find it hard to believe I didn't botch something with all of these changes :). But it is early enough in the release cycle to find and cleanup anything I missed, so I pushed the series. Thanks Michal, Eric, and Daniel for the reviews! Regards, Jim
participants (3)
-
Eric Blake
-
Jim Fehlig
-
Michal Privoznik