[PATCH V9 00/14] spec: Decompose the daemon subpackage

This is V9 of https://listman.redhat.com/archives/libvir-list/2023-January/237006.html The end goal is to remove the libvirt-dameon dependency on the various libvirt-daemon-driver-foo subpackages, allowing installation of a modular daemon configuration without the traditional monolithic libvirtd. Changes from V8: * Move adjustments to systemd service files to a new patch * Address more review comments Jim Fehlig (14): spec: Move virtlockd to a new subpackage libvirt-daemon-lock spec: Move virtlogd to a new subpackage libvirt-daemon-log spec: Move virtproxyd to a new subpackage libvirt-daemon-proxy spec: Move lockd plugin to a new subpackage spec: Rename the libvirt-lock-sanlock subpackage spec: Move common files and dependencies to libvirt-daemon-common spec: Add module-init-tools dependency to nodedev and lxc drivers spec: Add numad dependency to qemu and lxc drivers spec: Remove libvirt-daemon dependency from secondary drivers services: Weaken systemd dependency on virtlockd spec: Remove libvirt-daemon dependency from primary drivers spec: Remove libvirt-daemon dependency from hypervisor subpackages kbase: Update rpm-deployment.rst with new subpackages NEWS: Mention split of libvirt-daemon subpackage NEWS.rst | 6 + docs/kbase/rpm-deployment.rst | 48 +++-- libvirt.spec.in | 332 +++++++++++++++++++++++---------- src/libxl/virtxend.service.in | 2 +- src/qemu/virtqemud.service.in | 2 +- src/remote/libvirtd.service.in | 2 +- 6 files changed, 281 insertions(+), 111 deletions(-) -- 2.38.1

Signed-off-by: Jim Fehlig <jfehlig@suse.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com> --- libvirt.spec.in | 61 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 44 insertions(+), 17 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 77b274b6f9..bb0bfb5f35 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -432,6 +432,7 @@ Summary: Server side daemon and supporting files for libvirt library # The client side, i.e. shared libs are in a subpackage Requires: libvirt-libs = %{version}-%{release} +Requires: libvirt-daemon-lock = %{version}-%{release} # The libvirt-guests.sh script requires virsh from libvirt-client subpackage, # but not every deployment wants to use libvirt-guests service. Using # Recommends here will install libvirt-client by default (if available), but @@ -480,6 +481,14 @@ Server side daemon required to manage the virtualization capabilities of recent versions of Linux. Requires a hypervisor specific sub-RPM for specific drivers. +%package daemon-lock +Summary: Server side daemon for managing locks +Requires: libvirt-libs = %{version}-%{release} + +%description daemon-lock +Server side daemon used to manage locks held against virtual machine +resources + %package daemon-config-network Summary: Default configuration files for the libvirtd daemon @@ -1398,7 +1407,7 @@ fi \ %define libvirt_daemon_systemd_preun_priv() %systemd_preun %1.service %1-admin.socket %1.socket %pre daemon -%libvirt_sysconfig_pre libvirtd virtproxyd virtlogd virtlockd libvirt-guests +%libvirt_sysconfig_pre libvirtd virtproxyd virtlogd libvirt-guests # 'libvirt' group is just to allow password-less polkit access to # libvirtd. The uid number is irrelevant, so we use dynamic allocation # described at the above link. @@ -1407,7 +1416,6 @@ exit 0 %post daemon %libvirt_daemon_systemd_post_priv virtlogd -%libvirt_daemon_systemd_post_priv virtlockd %if %{with_modular_daemons} %libvirt_daemon_systemd_post_inet virtproxyd %else @@ -1421,17 +1429,16 @@ exit 0 %libvirt_daemon_systemd_preun_inet libvirtd %libvirt_daemon_systemd_preun_inet virtproxyd %libvirt_daemon_systemd_preun_priv virtlogd -%libvirt_daemon_systemd_preun_priv virtlockd %postun daemon /bin/systemctl daemon-reload >/dev/null 2>&1 || : if [ $1 -ge 1 ] ; then - /bin/systemctl reload-or-try-restart virtlockd.service virtlogd.service >/dev/null 2>&1 || : + /bin/systemctl reload-or-try-restart virtlogd.service >/dev/null 2>&1 || : fi %systemd_postun libvirt-guests.service %posttrans daemon -%libvirt_sysconfig_posttrans libvirtd virtproxyd virtlogd virtlockd libvirt-guests +%libvirt_sysconfig_posttrans libvirtd virtproxyd virtlogd libvirt-guests if test %libvirt_daemon_needs_restart libvirtd then # See if user has previously modified their install to @@ -1466,6 +1473,24 @@ then fi %libvirt_daemon_finish_restart libvirtd +%pre daemon-lock +%libvirt_sysconfig_pre virtlockd + +%post daemon-lock +%libvirt_daemon_systemd_post_priv virtlockd + +%preun daemon-lock +%libvirt_daemon_systemd_preun_priv virtlockd + +%postun daemon-lock +/bin/systemctl daemon-reload >/dev/null 2>&1 || : +if [ $1 -ge 1 ] ; then + /bin/systemctl reload-or-try-restart virtlockd.service >/dev/null 2>&1 || : +fi + +%posttrans daemon-lock +%libvirt_sysconfig_posttrans virtlockd + %pre daemon-driver-network %libvirt_sysconfig_pre virtnetworkd @@ -1747,14 +1772,10 @@ exit 0 %{_unitdir}/virtlogd.service %{_unitdir}/virtlogd.socket %{_unitdir}/virtlogd-admin.socket -%{_unitdir}/virtlockd.service -%{_unitdir}/virtlockd.socket -%{_unitdir}/virtlockd-admin.socket %{_unitdir}/libvirt-guests.service %config(noreplace) %{_sysconfdir}/libvirt/libvirtd.conf %config(noreplace) %{_sysconfdir}/libvirt/virtproxyd.conf %config(noreplace) %{_sysconfdir}/libvirt/virtlogd.conf -%config(noreplace) %{_sysconfdir}/libvirt/virtlockd.conf %config(noreplace) %{_sysconfdir}/sasl2/libvirt.conf %config(noreplace) %{_prefix}/lib/sysctl.d/60-libvirtd.conf %config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd @@ -1776,14 +1797,8 @@ exit 0 %{_datadir}/augeas/lenses/tests/test_libvirtd.aug %{_datadir}/augeas/lenses/virtlogd.aug %{_datadir}/augeas/lenses/tests/test_virtlogd.aug -%{_datadir}/augeas/lenses/virtlockd.aug -%{_datadir}/augeas/lenses/tests/test_virtlockd.aug %{_datadir}/augeas/lenses/virtproxyd.aug %{_datadir}/augeas/lenses/tests/test_virtproxyd.aug -%{_datadir}/augeas/lenses/libvirt_lockd.aug -%if %{with_qemu} -%{_datadir}/augeas/lenses/tests/test_libvirt_lockd.aug -%endif %{_datadir}/polkit-1/actions/org.libvirt.unix.policy %{_datadir}/polkit-1/actions/org.libvirt.api.policy %{_datadir}/polkit-1/rules.d/50-libvirt.rules @@ -1793,7 +1808,6 @@ exit 0 %attr(0755, root, root) %{_sbindir}/libvirtd %attr(0755, root, root) %{_sbindir}/virtproxyd %attr(0755, root, root) %{_sbindir}/virtlogd -%attr(0755, root, root) %{_sbindir}/virtlockd %attr(0755, root, root) %{_libexecdir}/libvirt-guests.sh %{_mandir}/man1/virt-admin.1* %{_mandir}/man1/virt-host-validate.1* @@ -1801,12 +1815,25 @@ exit 0 %{_mandir}/man8/libvirt-guests.8* %{_mandir}/man8/libvirtd.8* %{_mandir}/man8/virtlogd.8* -%{_mandir}/man8/virtlockd.8* %{_mandir}/man8/virtproxyd.8* %{_bindir}/virt-host-validate %{_bindir}/virt-admin %{_datadir}/bash-completion/completions/virt-admin +%files daemon-lock +%{_unitdir}/virtlockd.service +%{_unitdir}/virtlockd.socket +%{_unitdir}/virtlockd-admin.socket +%config(noreplace) %{_sysconfdir}/libvirt/virtlockd.conf +%{_datadir}/augeas/lenses/virtlockd.aug +%{_datadir}/augeas/lenses/tests/test_virtlockd.aug +%{_datadir}/augeas/lenses/libvirt_lockd.aug +%if %{with_qemu} +%{_datadir}/augeas/lenses/tests/test_libvirt_lockd.aug +%endif +%attr(0755, root, root) %{_sbindir}/virtlockd +%{_mandir}/man8/virtlockd.8* + %files daemon-config-network %dir %{_datadir}/libvirt/networks/ %{_datadir}/libvirt/networks/default.xml -- 2.38.1

Signed-off-by: Jim Fehlig <jfehlig@suse.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com> --- libvirt.spec.in | 53 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 15 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index bb0bfb5f35..19a3c8465c 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -433,6 +433,7 @@ Summary: Server side daemon and supporting files for libvirt library # The client side, i.e. shared libs are in a subpackage Requires: libvirt-libs = %{version}-%{release} Requires: libvirt-daemon-lock = %{version}-%{release} +Requires: libvirt-daemon-log = %{version}-%{release} # The libvirt-guests.sh script requires virsh from libvirt-client subpackage, # but not every deployment wants to use libvirt-guests service. Using # Recommends here will install libvirt-client by default (if available), but @@ -489,6 +490,13 @@ Requires: libvirt-libs = %{version}-%{release} Server side daemon used to manage locks held against virtual machine resources +%package daemon-log +Summary: Server side daemon for managing logs +Requires: libvirt-libs = %{version}-%{release} + +%description daemon-log +Server side daemon used to manage logs from virtual machine consoles + %package daemon-config-network Summary: Default configuration files for the libvirtd daemon @@ -1407,7 +1415,7 @@ fi \ %define libvirt_daemon_systemd_preun_priv() %systemd_preun %1.service %1-admin.socket %1.socket %pre daemon -%libvirt_sysconfig_pre libvirtd virtproxyd virtlogd libvirt-guests +%libvirt_sysconfig_pre libvirtd virtproxyd libvirt-guests # 'libvirt' group is just to allow password-less polkit access to # libvirtd. The uid number is irrelevant, so we use dynamic allocation # described at the above link. @@ -1415,7 +1423,6 @@ getent group libvirt >/dev/null || groupadd -r libvirt exit 0 %post daemon -%libvirt_daemon_systemd_post_priv virtlogd %if %{with_modular_daemons} %libvirt_daemon_systemd_post_inet virtproxyd %else @@ -1428,17 +1435,13 @@ exit 0 %systemd_preun libvirt-guests.service %libvirt_daemon_systemd_preun_inet libvirtd %libvirt_daemon_systemd_preun_inet virtproxyd -%libvirt_daemon_systemd_preun_priv virtlogd %postun daemon /bin/systemctl daemon-reload >/dev/null 2>&1 || : -if [ $1 -ge 1 ] ; then - /bin/systemctl reload-or-try-restart virtlogd.service >/dev/null 2>&1 || : -fi %systemd_postun libvirt-guests.service %posttrans daemon -%libvirt_sysconfig_posttrans libvirtd virtproxyd virtlogd libvirt-guests +%libvirt_sysconfig_posttrans libvirtd virtproxyd libvirt-guests if test %libvirt_daemon_needs_restart libvirtd then # See if user has previously modified their install to @@ -1491,6 +1494,24 @@ fi %posttrans daemon-lock %libvirt_sysconfig_posttrans virtlockd +%pre daemon-log +%libvirt_sysconfig_pre virtlogd + +%post daemon-log +%libvirt_daemon_systemd_post_priv virtlogd + +%preun daemon-log +%libvirt_daemon_systemd_preun_priv virtlogd + +%postun daemon-log +/bin/systemctl daemon-reload >/dev/null 2>&1 || : +if [ $1 -ge 1 ] ; then + /bin/systemctl reload-or-try-restart virtlogd.service >/dev/null 2>&1 || : +fi + +%posttrans daemon-log +%libvirt_sysconfig_posttrans virtlogd + %pre daemon-driver-network %libvirt_sysconfig_pre virtnetworkd @@ -1769,13 +1790,9 @@ exit 0 %{_unitdir}/virtproxyd-tcp.socket %{_unitdir}/virtproxyd-tls.socket %{_unitdir}/virt-guest-shutdown.target -%{_unitdir}/virtlogd.service -%{_unitdir}/virtlogd.socket -%{_unitdir}/virtlogd-admin.socket %{_unitdir}/libvirt-guests.service %config(noreplace) %{_sysconfdir}/libvirt/libvirtd.conf %config(noreplace) %{_sysconfdir}/libvirt/virtproxyd.conf -%config(noreplace) %{_sysconfdir}/libvirt/virtlogd.conf %config(noreplace) %{_sysconfdir}/sasl2/libvirt.conf %config(noreplace) %{_prefix}/lib/sysctl.d/60-libvirtd.conf %config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd @@ -1795,8 +1812,6 @@ exit 0 %attr(0755, root, root) %{_libdir}/libvirt/lock-driver/lockd.so %{_datadir}/augeas/lenses/libvirtd.aug %{_datadir}/augeas/lenses/tests/test_libvirtd.aug -%{_datadir}/augeas/lenses/virtlogd.aug -%{_datadir}/augeas/lenses/tests/test_virtlogd.aug %{_datadir}/augeas/lenses/virtproxyd.aug %{_datadir}/augeas/lenses/tests/test_virtproxyd.aug %{_datadir}/polkit-1/actions/org.libvirt.unix.policy @@ -1807,14 +1822,12 @@ exit 0 %attr(0755, root, root) %{_bindir}/virt-ssh-helper %attr(0755, root, root) %{_sbindir}/libvirtd %attr(0755, root, root) %{_sbindir}/virtproxyd -%attr(0755, root, root) %{_sbindir}/virtlogd %attr(0755, root, root) %{_libexecdir}/libvirt-guests.sh %{_mandir}/man1/virt-admin.1* %{_mandir}/man1/virt-host-validate.1* %{_mandir}/man8/virt-ssh-helper.8* %{_mandir}/man8/libvirt-guests.8* %{_mandir}/man8/libvirtd.8* -%{_mandir}/man8/virtlogd.8* %{_mandir}/man8/virtproxyd.8* %{_bindir}/virt-host-validate %{_bindir}/virt-admin @@ -1834,6 +1847,16 @@ exit 0 %attr(0755, root, root) %{_sbindir}/virtlockd %{_mandir}/man8/virtlockd.8* +%files daemon-log +%{_unitdir}/virtlogd.service +%{_unitdir}/virtlogd.socket +%{_unitdir}/virtlogd-admin.socket +%config(noreplace) %{_sysconfdir}/libvirt/virtlogd.conf +%{_datadir}/augeas/lenses/virtlogd.aug +%{_datadir}/augeas/lenses/tests/test_virtlogd.aug +%attr(0755, root, root) %{_sbindir}/virtlogd +%{_mandir}/man8/virtlogd.8* + %files daemon-config-network %dir %{_datadir}/libvirt/networks/ %{_datadir}/libvirt/networks/default.xml -- 2.38.1

Signed-off-by: Jim Fehlig <jfehlig@suse.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com> --- libvirt.spec.in | 68 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 45 insertions(+), 23 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 19a3c8465c..6072ac2c1c 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -434,17 +434,12 @@ Summary: Server side daemon and supporting files for libvirt library Requires: libvirt-libs = %{version}-%{release} Requires: libvirt-daemon-lock = %{version}-%{release} Requires: libvirt-daemon-log = %{version}-%{release} +Requires: libvirt-daemon-proxy = %{version}-%{release} # The libvirt-guests.sh script requires virsh from libvirt-client subpackage, # but not every deployment wants to use libvirt-guests service. Using # Recommends here will install libvirt-client by default (if available), but # RPM won't complain if the package is unavailable, masked, or removed later. Recommends: libvirt-client = %{version}-%{release} -# netcat is needed on the server side so that clients that have -# libvirt < 6.9.0 can connect, but newer versions will prefer -# virt-ssh-helper. Making this a Recommends means that it gets -# installed by default, but can still be removed if compatibility -# with old clients is not required -Recommends: /usr/bin/nc # for modprobe of pci devices Requires: module-init-tools # for /sbin/ip @@ -497,6 +492,20 @@ Requires: libvirt-libs = %{version}-%{release} %description daemon-log Server side daemon used to manage logs from virtual machine consoles +%package daemon-proxy +Summary: Server side daemon providing libvirtd proxy +Requires: libvirt-libs = %{version}-%{release} +# netcat is needed on the server side so that clients that have +# libvirt < 6.9.0 can connect, but newer versions will prefer +# virt-ssh-helper. Making this a Recommends means that it gets +# installed by default, but can still be removed if compatibility +# with old clients is not required +Recommends: /usr/bin/nc + +%description daemon-proxy +Server side daemon providing functionality previously provided by +the monolithic libvirtd + %package daemon-config-network Summary: Default configuration files for the libvirtd daemon @@ -1415,7 +1424,7 @@ fi \ %define libvirt_daemon_systemd_preun_priv() %systemd_preun %1.service %1-admin.socket %1.socket %pre daemon -%libvirt_sysconfig_pre libvirtd virtproxyd libvirt-guests +%libvirt_sysconfig_pre libvirtd libvirt-guests # 'libvirt' group is just to allow password-less polkit access to # libvirtd. The uid number is irrelevant, so we use dynamic allocation # described at the above link. @@ -1423,9 +1432,7 @@ getent group libvirt >/dev/null || groupadd -r libvirt exit 0 %post daemon -%if %{with_modular_daemons} -%libvirt_daemon_systemd_post_inet virtproxyd -%else +%if ! %{with_modular_daemons} %libvirt_daemon_systemd_post_inet libvirtd %endif %systemd_post libvirt-guests.service @@ -1434,14 +1441,13 @@ exit 0 %preun daemon %systemd_preun libvirt-guests.service %libvirt_daemon_systemd_preun_inet libvirtd -%libvirt_daemon_systemd_preun_inet virtproxyd %postun daemon /bin/systemctl daemon-reload >/dev/null 2>&1 || : %systemd_postun libvirt-guests.service %posttrans daemon -%libvirt_sysconfig_posttrans libvirtd virtproxyd libvirt-guests +%libvirt_sysconfig_posttrans libvirtd libvirt-guests if test %libvirt_daemon_needs_restart libvirtd then # See if user has previously modified their install to @@ -1512,6 +1518,20 @@ fi %posttrans daemon-log %libvirt_sysconfig_posttrans virtlogd +%pre daemon-proxy +%libvirt_sysconfig_pre virtproxyd + +%post daemon-proxy +%if %{with_modular_daemons} +%libvirt_daemon_systemd_post_inet virtproxyd +%endif + +%preun daemon-proxy +%libvirt_daemon_systemd_preun_inet virtproxyd + +%posttrans daemon-proxy +%libvirt_sysconfig_posttrans virtproxyd + %pre daemon-driver-network %libvirt_sysconfig_pre virtnetworkd @@ -1783,16 +1803,9 @@ exit 0 %{_unitdir}/libvirtd-admin.socket %{_unitdir}/libvirtd-tcp.socket %{_unitdir}/libvirtd-tls.socket -%{_unitdir}/virtproxyd.service -%{_unitdir}/virtproxyd.socket -%{_unitdir}/virtproxyd-ro.socket -%{_unitdir}/virtproxyd-admin.socket -%{_unitdir}/virtproxyd-tcp.socket -%{_unitdir}/virtproxyd-tls.socket %{_unitdir}/virt-guest-shutdown.target %{_unitdir}/libvirt-guests.service %config(noreplace) %{_sysconfdir}/libvirt/libvirtd.conf -%config(noreplace) %{_sysconfdir}/libvirt/virtproxyd.conf %config(noreplace) %{_sysconfdir}/sasl2/libvirt.conf %config(noreplace) %{_prefix}/lib/sysctl.d/60-libvirtd.conf %config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd @@ -1812,8 +1825,6 @@ exit 0 %attr(0755, root, root) %{_libdir}/libvirt/lock-driver/lockd.so %{_datadir}/augeas/lenses/libvirtd.aug %{_datadir}/augeas/lenses/tests/test_libvirtd.aug -%{_datadir}/augeas/lenses/virtproxyd.aug -%{_datadir}/augeas/lenses/tests/test_virtproxyd.aug %{_datadir}/polkit-1/actions/org.libvirt.unix.policy %{_datadir}/polkit-1/actions/org.libvirt.api.policy %{_datadir}/polkit-1/rules.d/50-libvirt.rules @@ -1821,14 +1832,12 @@ exit 0 %attr(0755, root, root) %{_libexecdir}/libvirt_iohelper %attr(0755, root, root) %{_bindir}/virt-ssh-helper %attr(0755, root, root) %{_sbindir}/libvirtd -%attr(0755, root, root) %{_sbindir}/virtproxyd %attr(0755, root, root) %{_libexecdir}/libvirt-guests.sh %{_mandir}/man1/virt-admin.1* %{_mandir}/man1/virt-host-validate.1* %{_mandir}/man8/virt-ssh-helper.8* %{_mandir}/man8/libvirt-guests.8* %{_mandir}/man8/libvirtd.8* -%{_mandir}/man8/virtproxyd.8* %{_bindir}/virt-host-validate %{_bindir}/virt-admin %{_datadir}/bash-completion/completions/virt-admin @@ -1857,6 +1866,19 @@ exit 0 %attr(0755, root, root) %{_sbindir}/virtlogd %{_mandir}/man8/virtlogd.8* +%files daemon-proxy +%{_unitdir}/virtproxyd.service +%{_unitdir}/virtproxyd.socket +%{_unitdir}/virtproxyd-ro.socket +%{_unitdir}/virtproxyd-admin.socket +%{_unitdir}/virtproxyd-tcp.socket +%{_unitdir}/virtproxyd-tls.socket +%config(noreplace) %{_sysconfdir}/libvirt/virtproxyd.conf +%{_datadir}/augeas/lenses/virtproxyd.aug +%{_datadir}/augeas/lenses/tests/test_virtproxyd.aug +%attr(0755, root, root) %{_sbindir}/virtproxyd +%{_mandir}/man8/virtproxyd.8* + %files daemon-config-network %dir %{_datadir}/libvirt/networks/ %{_datadir}/libvirt/networks/default.xml -- 2.38.1

Introduce the libvirt-daemon-plugin-lockd subpackage to provide the client-side lockd plugin for virtlockd. Signed-off-by: Jim Fehlig <jfehlig@suse.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com> --- libvirt.spec.in | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 6072ac2c1c..8277122bcb 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -433,6 +433,7 @@ Summary: Server side daemon and supporting files for libvirt library # The client side, i.e. shared libs are in a subpackage Requires: libvirt-libs = %{version}-%{release} Requires: libvirt-daemon-lock = %{version}-%{release} +Requires: libvirt-daemon-plugin-lockd = %{version}-%{release} Requires: libvirt-daemon-log = %{version}-%{release} Requires: libvirt-daemon-proxy = %{version}-%{release} # The libvirt-guests.sh script requires virsh from libvirt-client subpackage, @@ -485,6 +486,15 @@ Requires: libvirt-libs = %{version}-%{release} Server side daemon used to manage locks held against virtual machine resources +%package daemon-plugin-lockd +Summary: lockd client plugin for virtlockd +Requires: libvirt-libs = %{version}-%{release} +Requires: libvirt-daemon-lock = %{version}-%{release} + +%description daemon-plugin-lockd +A client-side plugin that implements disk locking using POSIX fcntl advisory +locks via communication with the virtlockd daemon + %package daemon-log Summary: Server side daemon for managing logs Requires: libvirt-libs = %{version}-%{release} @@ -1822,7 +1832,6 @@ exit 0 %dir %attr(0755, root, root) %{_libdir}/libvirt/lock-driver/ %dir %attr(0755, root, root) %{_libdir}/libvirt/storage-backend/ %dir %attr(0755, root, root) %{_libdir}/libvirt/storage-file/ -%attr(0755, root, root) %{_libdir}/libvirt/lock-driver/lockd.so %{_datadir}/augeas/lenses/libvirtd.aug %{_datadir}/augeas/lenses/tests/test_libvirtd.aug %{_datadir}/polkit-1/actions/org.libvirt.unix.policy @@ -1856,6 +1865,10 @@ exit 0 %attr(0755, root, root) %{_sbindir}/virtlockd %{_mandir}/man8/virtlockd.8* +%files daemon-plugin-lockd +%dir %attr(0755, root, root) %{_libdir}/libvirt/lock-driver/ +%attr(0755, root, root) %{_libdir}/libvirt/lock-driver/lockd.so + %files daemon-log %{_unitdir}/virtlogd.service %{_unitdir}/virtlogd.socket -- 2.38.1

The new name "libvirt-daemon-plugin-sanlock" provides consistency with the newly introduced "libvirt-daemon-plugin-lockd" subpackage. It's also a good opportunity to taking ownership of %{_libdir}/libvirt/lock-driver/, removing the need for a dependency on the libvirt-daemon package. Signed-off-by: Jim Fehlig <jfehlig@suse.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com> --- docs/kbase/rpm-deployment.rst | 12 ++++++------ libvirt.spec.in | 11 ++++++----- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/docs/kbase/rpm-deployment.rst b/docs/kbase/rpm-deployment.rst index 31805c2280..7685ee1291 100644 --- a/docs/kbase/rpm-deployment.rst +++ b/docs/kbase/rpm-deployment.rst @@ -289,6 +289,12 @@ RPM packages features, the subset of libvirt-daemon-driver-XXX packages should be used instead. +* libvirt-daemon-plugin-sanlock + + This package provides the sanlock.so module, a daemon plugin that implements + disk locking via communication with the sanlock daemon. It is optional and + only relevant to hosts with the QEMU driver and oVirt management application. + * libvirt-daemon-qemu This is an empty package that exists only as a convenient way to request @@ -352,12 +358,6 @@ RPM packages take to the libvirt daemons to utilize stateful drivers (QEMU, Xen, BHyve, LXC, VZ, etc). This is needed on all libvirt hosts, both client and server. -* libvirt-lock-sanlock - - A plugin for locking disks that communicates with the sanlock daemon. It is - optional and only relevant to hosts with the QEMU driver and oVirt management - application. - * libvirt-login-shell A simple login shell that automatically spawns an LXC container for the user diff --git a/libvirt.spec.in b/libvirt.spec.in index 8277122bcb..674718182b 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -962,15 +962,16 @@ Requires: pkgconfig Include header files & development libraries for the libvirt C library. %if %{with_sanlock} -%package lock-sanlock +%package daemon-plugin-sanlock Summary: Sanlock lock manager plugin for QEMU driver Requires: sanlock >= 2.4 #for virt-sanlock-cleanup require augeas Requires: augeas -Requires: libvirt-daemon = %{version}-%{release} Requires: libvirt-libs = %{version}-%{release} +Obsoletes: libvirt-lock-sanlock < 9.1.0 +Provides: libvirt-lock-sanlock = %{version}-%{release} -%description lock-sanlock +%description daemon-plugin-sanlock Includes the Sanlock lock manager plugin for the QEMU driver %endif @@ -1829,7 +1830,6 @@ exit 0 %dir %attr(0711, root, root) %{_localstatedir}/cache/libvirt/ %dir %attr(0755, root, root) %{_libdir}/libvirt/ %dir %attr(0755, root, root) %{_libdir}/libvirt/connection-driver/ -%dir %attr(0755, root, root) %{_libdir}/libvirt/lock-driver/ %dir %attr(0755, root, root) %{_libdir}/libvirt/storage-backend/ %dir %attr(0755, root, root) %{_libdir}/libvirt/storage-file/ %{_datadir}/augeas/lenses/libvirtd.aug @@ -2170,13 +2170,14 @@ exit 0 %endif %if %{with_sanlock} -%files lock-sanlock +%files daemon-plugin-sanlock %if %{with_qemu} %config(noreplace) %{_sysconfdir}/libvirt/qemu-sanlock.conf %endif %if %{with_libxl} %config(noreplace) %{_sysconfdir}/libvirt/libxl-sanlock.conf %endif +%dir %attr(0755, root, root) %{_libdir}/libvirt/lock-driver/ %attr(0755, root, root) %{_libdir}/libvirt/lock-driver/sanlock.so %{_datadir}/augeas/lenses/libvirt_sanlock.aug %{_datadir}/augeas/lenses/tests/test_libvirt_sanlock.aug -- 2.38.1

On Fri, Jan 13, 2023 at 12:21:52PM -0700, Jim Fehlig wrote:
The new name "libvirt-daemon-plugin-sanlock" provides consistency with the newly introduced "libvirt-daemon-plugin-lockd" subpackage.
It's also a good opportunity to taking ownership of %{_libdir}/libvirt/lock-driver/, removing the need for a dependency on the libvirt-daemon package.
Signed-off-by: Jim Fehlig <jfehlig@suse.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com> --- docs/kbase/rpm-deployment.rst | 12 ++++++------ libvirt.spec.in | 11 ++++++----- 2 files changed, 12 insertions(+), 11 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

Introduce a new subpackage libvirt-daemon-common and move virt-admin, virt-host-validate, virt-ssh-helper, libvirt-guests and miscellaneous files/directories to it. Also move common dependencies to the new subpackage. These files, utilities, and dependecies are used by other core libvirt daemons Signed-off-by: Jim Fehlig <jfehlig@suse.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com> --- libvirt.spec.in | 67 +++++++++++++++++++++++++++++++------------------ 1 file changed, 43 insertions(+), 24 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 674718182b..4c0767bbc7 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -432,10 +432,20 @@ Summary: Server side daemon and supporting files for libvirt library # The client side, i.e. shared libs are in a subpackage Requires: libvirt-libs = %{version}-%{release} +Requires: libvirt-daemon-common = %{version}-%{release} Requires: libvirt-daemon-lock = %{version}-%{release} Requires: libvirt-daemon-plugin-lockd = %{version}-%{release} Requires: libvirt-daemon-log = %{version}-%{release} Requires: libvirt-daemon-proxy = %{version}-%{release} + +%description daemon +Server side daemon required to manage the virtualization capabilities +of recent versions of Linux. Requires a hypervisor specific sub-RPM +for specific drivers. + +%package daemon-common +Summary: Files and utilities used by daemons +Requires: libvirt-libs = %{version}-%{release} # The libvirt-guests.sh script requires virsh from libvirt-client subpackage, # but not every deployment wants to use libvirt-guests service. Using # Recommends here will install libvirt-client by default (if available), but @@ -473,10 +483,8 @@ Obsoletes: libvirt-admin < 7.3.0 Provides: libvirt-admin = %{version}-%{release} Obsoletes: libvirt-bash-completion < 7.3.0 -%description daemon -Server side daemon required to manage the virtualization capabilities -of recent versions of Linux. Requires a hypervisor specific sub-RPM -for specific drivers. +%description daemon-common +Miscellaneous files and utilities used by other libvirt daemons %package daemon-lock Summary: Server side daemon for managing locks @@ -1435,30 +1443,19 @@ fi \ %define libvirt_daemon_systemd_preun_priv() %systemd_preun %1.service %1-admin.socket %1.socket %pre daemon -%libvirt_sysconfig_pre libvirtd libvirt-guests -# 'libvirt' group is just to allow password-less polkit access to -# libvirtd. The uid number is irrelevant, so we use dynamic allocation -# described at the above link. -getent group libvirt >/dev/null || groupadd -r libvirt -exit 0 +%libvirt_sysconfig_pre libvirtd %post daemon %if ! %{with_modular_daemons} %libvirt_daemon_systemd_post_inet libvirtd %endif -%systemd_post libvirt-guests.service %libvirt_daemon_schedule_restart libvirtd %preun daemon -%systemd_preun libvirt-guests.service %libvirt_daemon_systemd_preun_inet libvirtd -%postun daemon -/bin/systemctl daemon-reload >/dev/null 2>&1 || : -%systemd_postun libvirt-guests.service - %posttrans daemon -%libvirt_sysconfig_posttrans libvirtd libvirt-guests +%libvirt_sysconfig_posttrans libvirtd if test %libvirt_daemon_needs_restart libvirtd then # See if user has previously modified their install to @@ -1493,6 +1490,26 @@ then fi %libvirt_daemon_finish_restart libvirtd +%pre daemon-common +%libvirt_sysconfig_pre libvirt-guests +# 'libvirt' group is just to allow password-less polkit access to libvirt +# daemons. The uid number is irrelevant, so we use dynamic allocation. +getent group libvirt >/dev/null || groupadd -r libvirt +exit 0 + +%post daemon-common +%systemd_post libvirt-guests.service + +%preun daemon-common +%systemd_preun libvirt-guests.service + +%postun daemon-common +/bin/systemctl daemon-reload >/dev/null 2>&1 || : +%systemd_postun libvirt-guests.service + +%posttrans daemon-common +%libvirt_sysconfig_posttrans libvirt-guests + %pre daemon-lock %libvirt_sysconfig_pre virtlockd @@ -1814,12 +1831,18 @@ exit 0 %{_unitdir}/libvirtd-admin.socket %{_unitdir}/libvirtd-tcp.socket %{_unitdir}/libvirtd-tls.socket -%{_unitdir}/virt-guest-shutdown.target -%{_unitdir}/libvirt-guests.service %config(noreplace) %{_sysconfdir}/libvirt/libvirtd.conf -%config(noreplace) %{_sysconfdir}/sasl2/libvirt.conf %config(noreplace) %{_prefix}/lib/sysctl.d/60-libvirtd.conf %config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd +%{_datadir}/augeas/lenses/libvirtd.aug +%{_datadir}/augeas/lenses/tests/test_libvirtd.aug +%attr(0755, root, root) %{_sbindir}/libvirtd +%{_mandir}/man8/libvirtd.8* + +%files daemon-common +%{_unitdir}/virt-guest-shutdown.target +%{_unitdir}/libvirt-guests.service +%config(noreplace) %{_sysconfdir}/sasl2/libvirt.conf %dir %{_datadir}/libvirt/ %ghost %dir %{_rundir}/libvirt/ %ghost %dir %{_rundir}/libvirt/common/ @@ -1832,21 +1855,17 @@ exit 0 %dir %attr(0755, root, root) %{_libdir}/libvirt/connection-driver/ %dir %attr(0755, root, root) %{_libdir}/libvirt/storage-backend/ %dir %attr(0755, root, root) %{_libdir}/libvirt/storage-file/ -%{_datadir}/augeas/lenses/libvirtd.aug -%{_datadir}/augeas/lenses/tests/test_libvirtd.aug %{_datadir}/polkit-1/actions/org.libvirt.unix.policy %{_datadir}/polkit-1/actions/org.libvirt.api.policy %{_datadir}/polkit-1/rules.d/50-libvirt.rules %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/ %attr(0755, root, root) %{_libexecdir}/libvirt_iohelper %attr(0755, root, root) %{_bindir}/virt-ssh-helper -%attr(0755, root, root) %{_sbindir}/libvirtd %attr(0755, root, root) %{_libexecdir}/libvirt-guests.sh %{_mandir}/man1/virt-admin.1* %{_mandir}/man1/virt-host-validate.1* %{_mandir}/man8/virt-ssh-helper.8* %{_mandir}/man8/libvirt-guests.8* -%{_mandir}/man8/libvirtd.8* %{_bindir}/virt-host-validate %{_bindir}/virt-admin %{_datadir}/bash-completion/completions/virt-admin -- 2.38.1

On Fri, Jan 13, 2023 at 12:21:53PM -0700, Jim Fehlig wrote:
Introduce a new subpackage libvirt-daemon-common and move virt-admin, virt-host-validate, virt-ssh-helper, libvirt-guests and miscellaneous files/directories to it. Also move common dependencies to the new subpackage. These files, utilities, and dependecies are used by other core libvirt daemons
Signed-off-by: Jim Fehlig <jfehlig@suse.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com> --- libvirt.spec.in | 67 +++++++++++++++++++++++++++++++------------------ 1 file changed, 43 insertions(+), 24 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

Only the nodedev and lxc drivers require module-init-tools. Remove the dependency from libvirt-daemon-common and add it to the nodedev and lxc drivers. This avoids enforcing the dependency on all users of libvirt-daemon-common. Signed-off-by: Jim Fehlig <jfehlig@suse.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com> --- libvirt.spec.in | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 4c0767bbc7..5ce1099ff3 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -451,8 +451,6 @@ Requires: libvirt-libs = %{version}-%{release} # Recommends here will install libvirt-client by default (if available), but # RPM won't complain if the package is unavailable, masked, or removed later. Recommends: libvirt-client = %{version}-%{release} -# for modprobe of pci devices -Requires: module-init-tools # for /sbin/ip Requires: iproute # for /sbin/tc @@ -574,6 +572,8 @@ Requires: libvirt-libs = %{version}-%{release} Requires: systemd >= 185 # For managing persistent mediated devices Requires: mdevctl +# for modprobe of pci devices +Requires: module-init-tools %description daemon-driver-nodedev The nodedev driver plugin for the libvirtd daemon, providing @@ -782,6 +782,8 @@ Requires: libvirt-libs = %{version}-%{release} # There really is a hard cross-driver dependency here Requires: libvirt-daemon-driver-network = %{version}-%{release} Requires: systemd-container +# for modprobe of nbd driver +Requires: module-init-tools %description daemon-driver-lxc The LXC driver plugin for the libvirtd daemon, providing -- 2.38.1

Both drivers use numad via virNumaGetAutoPlacementAdvice. Drop the numad dependency from libvirt-daemon-common to avoid enforcing it all users of the subpackage. Signed-off-by: Jim Fehlig <jfehlig@suse.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com> --- libvirt.spec.in | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 5ce1099ff3..e1a5477711 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -462,9 +462,6 @@ Requires: dmidecode %endif # For service management Requires(post): /usr/bin/systemctl -%if %{with_numad} -Requires: numad -%endif # libvirtd depends on 'messagebus' service Requires: dbus # For uid creation during pre @@ -764,6 +761,9 @@ Requires: lzop Requires: xz Requires: systemd-container Requires: swtpm-tools + %if %{with_numad} +Requires: numad + %endif %if (0%{?fedora} >= 36) || (0%{?rhel} >= 9) Recommends: passt %endif @@ -784,6 +784,9 @@ Requires: libvirt-daemon-driver-network = %{version}-%{release} Requires: systemd-container # for modprobe of nbd driver Requires: module-init-tools + %if %{with_numad} +Requires: numad + %endif %description daemon-driver-lxc The LXC driver plugin for the libvirtd daemon, providing -- 2.38.1

To avoid needlessly installing the monolithic daemon, replace the libvirt-daemon dependency with libvirt-daemon-common in the secondary drivers. The common subpackage contains all the utilities and files needed by the secondary drivers. Signed-off-by: Jim Fehlig <jfehlig@suse.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com> --- libvirt.spec.in | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index e1a5477711..4886b91bf8 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -522,7 +522,6 @@ the monolithic libvirtd %package daemon-config-network Summary: Default configuration files for the libvirtd daemon -Requires: libvirt-daemon = %{version}-%{release} Requires: libvirt-daemon-driver-network = %{version}-%{release} %description daemon-config-network @@ -531,7 +530,6 @@ Default configuration files for setting up NAT based networking %package daemon-config-nwfilter Summary: Network filter configuration files for the libvirtd daemon -Requires: libvirt-daemon = %{version}-%{release} Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release} %description daemon-config-nwfilter @@ -539,7 +537,7 @@ Network filter configuration files for cleaning guest traffic %package daemon-driver-network Summary: Network driver plugin for the libvirtd daemon -Requires: libvirt-daemon = %{version}-%{release} +Requires: libvirt-daemon-common = %{version}-%{release} Requires: libvirt-libs = %{version}-%{release} Requires: dnsmasq >= 2.41 Requires: iptables @@ -551,7 +549,7 @@ bridge capabilities. %package daemon-driver-nwfilter Summary: Nwfilter driver plugin for the libvirtd daemon -Requires: libvirt-daemon = %{version}-%{release} +Requires: libvirt-daemon-common = %{version}-%{release} Requires: libvirt-libs = %{version}-%{release} Requires: iptables Requires: ebtables @@ -563,7 +561,7 @@ iptables and ip6tables capabilities %package daemon-driver-nodedev Summary: Nodedev driver plugin for the libvirtd daemon -Requires: libvirt-daemon = %{version}-%{release} +Requires: libvirt-daemon-common = %{version}-%{release} Requires: libvirt-libs = %{version}-%{release} # needed for device enumeration Requires: systemd >= 185 @@ -579,7 +577,7 @@ capabilities. %package daemon-driver-interface Summary: Interface driver plugin for the libvirtd daemon -Requires: libvirt-daemon = %{version}-%{release} +Requires: libvirt-daemon-common = %{version}-%{release} Requires: libvirt-libs = %{version}-%{release} %if %{with_netcf} Requires: netcf-libs >= 0.2.2 @@ -591,7 +589,7 @@ an implementation of the host network interface APIs. %package daemon-driver-secret Summary: Secret driver plugin for the libvirtd daemon -Requires: libvirt-daemon = %{version}-%{release} +Requires: libvirt-daemon-common = %{version}-%{release} Requires: libvirt-libs = %{version}-%{release} %description daemon-driver-secret @@ -600,7 +598,7 @@ an implementation of the secret key APIs. %package daemon-driver-storage-core Summary: Storage driver plugin including base backends for the libvirtd daemon -Requires: libvirt-daemon = %{version}-%{release} +Requires: libvirt-daemon-common = %{version}-%{release} Requires: libvirt-libs = %{version}-%{release} Requires: nfs-utils # For mkfs -- 2.38.1

The systemd service files of the qemu and libxl driver currently have a 'Requires' dependency on virtlockd, which is too strong since virtlockd is not enabled by default in either driver. Change the dependency to a 'Wants' to avoid a package dependency between the driver subpackages and the new libvirt-daemon-lock subpackage. Signed-off-by: Jim Fehlig <jfehlig@suse.com> --- src/libxl/virtxend.service.in | 2 +- src/qemu/virtqemud.service.in | 2 +- src/remote/libvirtd.service.in | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libxl/virtxend.service.in b/src/libxl/virtxend.service.in index 6b083c414f..9171d4fdf8 100644 --- a/src/libxl/virtxend.service.in +++ b/src/libxl/virtxend.service.in @@ -1,10 +1,10 @@ [Unit] Description=Virtualization xen daemon Conflicts=libvirtd.service -Requires=virtlockd.socket Requires=virtxend.socket Requires=virtxend-ro.socket Requires=virtxend-admin.socket +Wants=virtlockd.socket After=network.target After=dbus.service After=apparmor.service diff --git a/src/qemu/virtqemud.service.in b/src/qemu/virtqemud.service.in index 9ae3f01fa0..315359e287 100644 --- a/src/qemu/virtqemud.service.in +++ b/src/qemu/virtqemud.service.in @@ -2,10 +2,10 @@ Description=Virtualization qemu daemon Conflicts=libvirtd.service Requires=virtlogd.socket -Requires=virtlockd.socket Requires=virtqemud.socket Requires=virtqemud-ro.socket Requires=virtqemud-admin.socket +Wants=virtlockd.socket Wants=systemd-machined.service After=network.target After=dbus.service diff --git a/src/remote/libvirtd.service.in b/src/remote/libvirtd.service.in index 954df5d1e5..30588279f8 100644 --- a/src/remote/libvirtd.service.in +++ b/src/remote/libvirtd.service.in @@ -1,13 +1,13 @@ [Unit] Description=Virtualization daemon Requires=virtlogd.socket -Requires=virtlockd.socket # Use Wants instead of Requires so that users # can disable these three .socket units to revert # to a traditional non-activation deployment setup Wants=libvirtd.socket Wants=libvirtd-ro.socket Wants=libvirtd-admin.socket +Wants=virtlockd.socket Wants=systemd-machined.service After=network.target After=firewalld.service -- 2.38.1

On Fri, Jan 13, 2023 at 12:21:57PM -0700, Jim Fehlig wrote:
The systemd service files of the qemu and libxl driver currently have a 'Requires' dependency on virtlockd, which is too strong since virtlockd is not enabled by default in either driver. Change the dependency to a 'Wants' to avoid a package dependency between the driver subpackages and the new libvirt-daemon-lock subpackage.
Signed-off-by: Jim Fehlig <jfehlig@suse.com> --- src/libxl/virtxend.service.in | 2 +- src/qemu/virtqemud.service.in | 2 +- src/remote/libvirtd.service.in | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
Reviewed-by: Andrea Bolognani <abologna@redhat.com> -- Andrea Bolognani / Red Hat / Virtualization

On Fri, Jan 13, 2023 at 12:21:57PM -0700, Jim Fehlig wrote:
The systemd service files of the qemu and libxl driver currently have a 'Requires' dependency on virtlockd, which is too strong since virtlockd is not enabled by default in either driver. Change the dependency to a 'Wants' to avoid a package dependency between the driver subpackages and the new libvirt-daemon-lock subpackage.
Signed-off-by: Jim Fehlig <jfehlig@suse.com> --- src/libxl/virtxend.service.in | 2 +- src/qemu/virtqemud.service.in | 2 +- src/remote/libvirtd.service.in | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

To avoid needlessly installing the monolithic daemon, replace the libvirt-daemon dependency with libvirt-daemon-common in the primary drivers. The qemu driver also needs a dependency on libvirt-daemon-log since the virtqemud systemd service file has a hard dependency on virtlogd.socket. Signed-off-by: Jim Fehlig <jfehlig@suse.com> --- libvirt.spec.in | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 4886b91bf8..5e769ee32f 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -749,7 +749,8 @@ parted and more. %if %{with_qemu} %package daemon-driver-qemu Summary: QEMU driver plugin for the libvirtd daemon -Requires: libvirt-daemon = %{version}-%{release} +Requires: libvirt-daemon-common = %{version}-%{release} +Requires: libvirt-daemon-log = %{version}-%{release} Requires: libvirt-libs = %{version}-%{release} Requires: /usr/bin/qemu-img # For image compression @@ -775,7 +776,7 @@ QEMU %if %{with_lxc} %package daemon-driver-lxc Summary: LXC driver plugin for the libvirtd daemon -Requires: libvirt-daemon = %{version}-%{release} +Requires: libvirt-daemon-common = %{version}-%{release} Requires: libvirt-libs = %{version}-%{release} # There really is a hard cross-driver dependency here Requires: libvirt-daemon-driver-network = %{version}-%{release} @@ -795,7 +796,7 @@ the Linux kernel %if %{with_vbox} %package daemon-driver-vbox Summary: VirtualBox driver plugin for the libvirtd daemon -Requires: libvirt-daemon = %{version}-%{release} +Requires: libvirt-daemon-common = %{version}-%{release} Requires: libvirt-libs = %{version}-%{release} %description daemon-driver-vbox @@ -807,7 +808,7 @@ VirtualBox %if %{with_libxl} %package daemon-driver-libxl Summary: Libxl driver plugin for the libvirtd daemon -Requires: libvirt-daemon = %{version}-%{release} +Requires: libvirt-daemon-common = %{version}-%{release} Requires: libvirt-libs = %{version}-%{release} Obsoletes: libvirt-daemon-driver-xen < 4.3.0 -- 2.38.1

On Fri, Jan 13, 2023 at 12:21:58PM -0700, Jim Fehlig wrote:
To avoid needlessly installing the monolithic daemon, replace the libvirt-daemon dependency with libvirt-daemon-common in the primary drivers.
The qemu driver also needs a dependency on libvirt-daemon-log since the virtqemud systemd service file has a hard dependency on virtlogd.socket.
Signed-off-by: Jim Fehlig <jfehlig@suse.com> --- libvirt.spec.in | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
Reviewed-by: Andrea Bolognani <abologna@redhat.com> -- Andrea Bolognani / Red Hat / Virtualization

On Fri, Jan 13, 2023 at 12:21:58PM -0700, Jim Fehlig wrote:
To avoid needlessly installing the monolithic daemon, replace the libvirt-daemon dependency with libvirt-daemon-common in the primary drivers.
The qemu driver also needs a dependency on libvirt-daemon-log since the virtqemud systemd service file has a hard dependency on virtlogd.socket.
Signed-off-by: Jim Fehlig <jfehlig@suse.com> --- libvirt.spec.in | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

Remove the libvirt-daemon dependency from the various libvirt-daemon-<hypervisor> subpackages, replacing it with a set of the new sub subpackages providing similar functionality. When libvirt is build with modular daemons, the hypervisor subpackages no longer include the traditional, monolithic libvirt daemon. Signed-off-by: Jim Fehlig <jfehlig@suse.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com> --- libvirt.spec.in | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/libvirt.spec.in b/libvirt.spec.in index 5e769ee32f..cb325406de 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -822,7 +822,15 @@ Libxl %package daemon-qemu Summary: Server side daemon & driver required to run QEMU guests + %if %{with_modular_daemons} +Requires: libvirt-daemon-common = %{version}-%{release} +Requires: libvirt-daemon-log = %{version}-%{release} +Requires: libvirt-daemon-lock = %{version}-%{release} +Requires: libvirt-daemon-plugin-lockd = %{version}-%{release} +Requires: libvirt-daemon-proxy = %{version}-%{release} + %else Requires: libvirt-daemon = %{version}-%{release} + %endif Requires: libvirt-daemon-driver-qemu = %{version}-%{release} Requires: libvirt-daemon-driver-interface = %{version}-%{release} Requires: libvirt-daemon-driver-network = %{version}-%{release} @@ -841,7 +849,15 @@ capabilities of the QEMU TCG emulators %package daemon-kvm Summary: Server side daemon & driver required to run KVM guests + %if %{with_modular_daemons} +Requires: libvirt-daemon-common = %{version}-%{release} +Requires: libvirt-daemon-log = %{version}-%{release} +Requires: libvirt-daemon-lock = %{version}-%{release} +Requires: libvirt-daemon-plugin-lockd = %{version}-%{release} +Requires: libvirt-daemon-proxy = %{version}-%{release} + %else Requires: libvirt-daemon = %{version}-%{release} + %endif Requires: libvirt-daemon-driver-qemu = %{version}-%{release} Requires: libvirt-daemon-driver-interface = %{version}-%{release} Requires: libvirt-daemon-driver-network = %{version}-%{release} @@ -860,7 +876,12 @@ capabilities of the KVM hypervisor %package daemon-lxc Summary: Server side daemon & driver required to run LXC guests + %if %{with_modular_daemons} +Requires: libvirt-daemon-common = %{version}-%{release} +Requires: libvirt-daemon-proxy = %{version}-%{release} + %else Requires: libvirt-daemon = %{version}-%{release} + %endif Requires: libvirt-daemon-driver-lxc = %{version}-%{release} Requires: libvirt-daemon-driver-interface = %{version}-%{release} Requires: libvirt-daemon-driver-network = %{version}-%{release} @@ -878,7 +899,14 @@ capabilities of LXC %package daemon-xen Summary: Server side daemon & driver required to run XEN guests + %if %{with_modular_daemons} +Requires: libvirt-daemon-common = %{version}-%{release} +Requires: libvirt-daemon-lock = %{version}-%{release} +Requires: libvirt-daemon-plugin-lockd = %{version}-%{release} +Requires: libvirt-daemon-proxy = %{version}-%{release} + %else Requires: libvirt-daemon = %{version}-%{release} + %endif Requires: libvirt-daemon-driver-libxl = %{version}-%{release} Requires: libvirt-daemon-driver-interface = %{version}-%{release} Requires: libvirt-daemon-driver-network = %{version}-%{release} @@ -897,7 +925,12 @@ capabilities of XEN %package daemon-vbox Summary: Server side daemon & driver required to run VirtualBox guests + %if %{with_modular_daemons} +Requires: libvirt-daemon-common = %{version}-%{release} +Requires: libvirt-daemon-proxy = %{version}-%{release} + %else Requires: libvirt-daemon = %{version}-%{release} + %endif Requires: libvirt-daemon-driver-vbox = %{version}-%{release} Requires: libvirt-daemon-driver-interface = %{version}-%{release} Requires: libvirt-daemon-driver-network = %{version}-%{release} -- 2.38.1

On Fri, Jan 13, 2023 at 12:21:59PM -0700, Jim Fehlig wrote:
Remove the libvirt-daemon dependency from the various libvirt-daemon-<hypervisor> subpackages, replacing it with a set of the new sub subpackages providing similar functionality. When libvirt is build with modular daemons, the hypervisor subpackages no longer include the traditional, monolithic libvirt daemon.
Signed-off-by: Jim Fehlig <jfehlig@suse.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com> --- libvirt.spec.in | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

Signed-off-by: Jim Fehlig <jfehlig@suse.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com> --- docs/kbase/rpm-deployment.rst | 36 ++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/docs/kbase/rpm-deployment.rst b/docs/kbase/rpm-deployment.rst index 7685ee1291..26fe1be8e6 100644 --- a/docs/kbase/rpm-deployment.rst +++ b/docs/kbase/rpm-deployment.rst @@ -109,14 +109,17 @@ RPM packages stateful drivers. This package does not contain any drivers, so further packages need to be installed to provide the desired drivers. - In addition to the libvirtd daemon this package also contains the virtlogd, - virtlockd and virtproxyd daemons, plus a number of helpers, configuration - files and other bits necessary to create and admin a virtualization host. + New installations should not use this package, instead opting for one of + the modular daemon deployment options. - The virt-admin tool, also included in this package, is used for - administrative operations on any libvirt daemons. Most usefully it allows - for logging filters and outputs to be reconfigured on a running daemon - without a restart. +* libvirt-daemon-common + This package contains libvirt-guests, virt-host-validate, virt-ssh-helper + and other utilities and configuration files necessary to create and + administer a virtualization host. + + The virt-admin tool, used for administrative operations on any of the libvirt + daemons, is also included in this package. It is most useful for reconfiguring + logging filters and outputs on a running daemon without the need for a restart. * libvirt-daemon-config-network @@ -276,6 +279,14 @@ RPM packages features, the subset of libvirt-daemon-driver-XXX packages should be used instead. +* libvirt-daemon-lock + This package provides virtlockd, a server side daemon used to manage locks + held against virtual machine resources. + +* libvirt-daemon-log + This package provides virtlogd, a server side daemon used to manage logs + from virtual machine consoles. + * libvirt-daemon-lxc This is an empty package that exists only as a convenient way to request @@ -289,12 +300,23 @@ RPM packages features, the subset of libvirt-daemon-driver-XXX packages should be used instead. +* libvirt-daemon-plugin-lockd + This package provides the lockd.so module, a daemon plugin that implements + disk locking using POSIX fcntl advisory locks via communication with the + virtlockd daemon. + * libvirt-daemon-plugin-sanlock This package provides the sanlock.so module, a daemon plugin that implements disk locking via communication with the sanlock daemon. It is optional and only relevant to hosts with the QEMU driver and oVirt management application. +* libvirt-daemon-proxy + This package provides virtproxyd, a server side daemon providing remote + network access to libvirt daemons, as well as backwards compatibility + for older libvirt clients expecting to communicate with the traditional, + monolithic libvirtd. + * libvirt-daemon-qemu This is an empty package that exists only as a convenient way to request -- 2.38.1

Signed-off-by: Jim Fehlig <jfehlig@suse.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com> --- NEWS.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 9baf10b8e9..c533c0824f 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -50,6 +50,12 @@ v9.0.0 (unreleased) With sufficiently new QEMU (v7.1.0) screenshots change format from PPM to PNG. + * RPM packaging changes + + The ``libvirt-daemon`` subpackage is split into several new subpackages, + allowing installation of a modular daemon configuration without the + traditional monolithic libvirtd. + * **Bug fixes** * Fix NULL-pointer dereference `virXMLPropStringRequired` -- 2.38.1

All patches in this series contain a R-B from Andrea or Daniel. Andrea, can this be pushed now or did you want a final blessing from Daniel? Regards, Jim On 1/13/23 12:21, Jim Fehlig wrote:
This is V9 of
https://listman.redhat.com/archives/libvir-list/2023-January/237006.html
The end goal is to remove the libvirt-dameon dependency on the various libvirt-daemon-driver-foo subpackages, allowing installation of a modular daemon configuration without the traditional monolithic libvirtd.
Changes from V8: * Move adjustments to systemd service files to a new patch * Address more review comments
Jim Fehlig (14): spec: Move virtlockd to a new subpackage libvirt-daemon-lock spec: Move virtlogd to a new subpackage libvirt-daemon-log spec: Move virtproxyd to a new subpackage libvirt-daemon-proxy spec: Move lockd plugin to a new subpackage spec: Rename the libvirt-lock-sanlock subpackage spec: Move common files and dependencies to libvirt-daemon-common spec: Add module-init-tools dependency to nodedev and lxc drivers spec: Add numad dependency to qemu and lxc drivers spec: Remove libvirt-daemon dependency from secondary drivers services: Weaken systemd dependency on virtlockd spec: Remove libvirt-daemon dependency from primary drivers spec: Remove libvirt-daemon dependency from hypervisor subpackages kbase: Update rpm-deployment.rst with new subpackages NEWS: Mention split of libvirt-daemon subpackage
NEWS.rst | 6 + docs/kbase/rpm-deployment.rst | 48 +++-- libvirt.spec.in | 332 +++++++++++++++++++++++---------- src/libxl/virtxend.service.in | 2 +- src/qemu/virtqemud.service.in | 2 +- src/remote/libvirtd.service.in | 2 +- 6 files changed, 281 insertions(+), 111 deletions(-)

On Tue, Jan 17, 2023 at 11:50:10AM -0700, Jim Fehlig wrote:
All patches in this series contain a R-B from Andrea or Daniel. Andrea, can this be pushed now or did you want a final blessing from Daniel?
I have no further comments. With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On Tue, Jan 17, 2023 at 06:58:39PM +0000, Daniel P. Berrangé wrote:
On Tue, Jan 17, 2023 at 11:50:10AM -0700, Jim Fehlig wrote:
All patches in this series contain a R-B from Andrea or Daniel. Andrea, can this be pushed now or did you want a final blessing from Daniel?
I have no further comments.
So can you please give your R-b to the few patches that are missing it? -- Andrea Bolognani / Red Hat / Virtualization
participants (3)
-
Andrea Bolognani
-
Daniel P. Berrangé
-
Jim Fehlig