[PATCH V7 00/12] spec: Decompose the daemon subpackage

This is V7 of https://listman.redhat.com/archives/libvir-list/2023-January/236586.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 V6: * Revert to including virtlockd and lockd plugin in the hypervisor subpackages * Add NEWS entry Jim Fehlig (12): 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 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 | 331 ++++++++++++++++++++++++---------- 3 files changed, 277 insertions(+), 108 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 6b8acf252e..33398b2877 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -429,6 +429,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 @@ -477,6 +478,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 @@ -1392,7 +1401,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. @@ -1401,7 +1410,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 @@ -1415,17 +1423,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 @@ -1459,6 +1466,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 @@ -1740,14 +1765,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 @@ -1769,14 +1790,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 @@ -1786,7 +1801,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* @@ -1794,12 +1808,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 33398b2877..d303cac9df 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -430,6 +430,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 @@ -486,6 +487,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 @@ -1401,7 +1409,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. @@ -1409,7 +1417,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 @@ -1422,17 +1429,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 @@ -1484,6 +1487,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 @@ -1762,13 +1783,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 @@ -1788,8 +1805,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 @@ -1800,14 +1815,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 @@ -1827,6 +1840,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 d303cac9df..a2bc591333 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -431,17 +431,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 @@ -494,6 +489,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 @@ -1409,7 +1418,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. @@ -1417,9 +1426,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 @@ -1428,14 +1435,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 @@ -1505,6 +1511,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 @@ -1776,16 +1796,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 @@ -1805,8 +1818,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 @@ -1814,14 +1825,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 @@ -1850,6 +1859,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 a2bc591333..7c011c68cb 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -430,6 +430,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, @@ -482,6 +483,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} @@ -1815,7 +1825,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 @@ -1849,6 +1858,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 7c011c68cb..dd1b6a74e9 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -956,15 +956,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.0.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 @@ -1822,7 +1823,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 @@ -2162,13 +2162,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

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 | 77 ++++++++++++++++++++++++++++++------------------- 1 file changed, 48 insertions(+), 29 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index dd1b6a74e9..12151cb90f 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -429,17 +429,30 @@ 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} +# for modprobe of pci devices +Requires: module-init-tools +%if %{with_numad} +Requires: numad +%endif + +%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 # 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 @@ -451,9 +464,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 @@ -470,10 +480,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 @@ -1429,30 +1437,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 @@ -1486,6 +1483,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 @@ -1807,12 +1824,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/ @@ -1825,21 +1848,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

Both the nodedev and lxc drivers can load kernel modules. Add a module-init-tools dependency to the drivers and remove the dependency from libvirt-daemon. 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 12151cb90f..a86d9b99ee 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -434,8 +434,6 @@ 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} -# for modprobe of pci devices -Requires: module-init-tools %if %{with_numad} Requires: numad %endif @@ -571,6 +569,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 @@ -776,6 +776,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. 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 a86d9b99ee..3927698dcd 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -434,9 +434,6 @@ 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} -%if %{with_numad} -Requires: numad -%endif %description daemon Server side daemon required to manage the virtualization capabilities @@ -761,6 +758,9 @@ Requires: lzop Requires: xz Requires: systemd-container Requires: swtpm-tools + %if %{with_numad} +Requires: numad + %endif %description daemon-driver-qemu The qemu driver plugin for the libvirtd daemon, providing @@ -778,6 +778,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. The common subpackage contains all the utilities (e.g. virt-admin) and files used by other daemons. 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 | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 3927698dcd..2cc77a2622 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -519,7 +519,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 @@ -528,7 +527,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 @@ -536,7 +534,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 @@ -548,7 +546,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 @@ -560,7 +558,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 @@ -576,7 +574,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 @@ -588,7 +586,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 @@ -597,7 +595,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 @@ -748,7 +746,7 @@ 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-libs = %{version}-%{release} Requires: /usr/bin/qemu-img # For image compression @@ -771,7 +769,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} @@ -791,7 +789,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 @@ -803,7 +801,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 1/9/23 10:42, Jim Fehlig wrote:
To avoid needlessly installing the monolithic daemon, replace the libvirt-daemon dependency with libvirt-daemon-common. The common subpackage contains all the utilities (e.g. virt-admin) and files used by other daemons.
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 | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in index 3927698dcd..2cc77a2622 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -519,7 +519,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 @@ -528,7 +527,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 @@ -536,7 +534,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 @@ -548,7 +546,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 @@ -560,7 +558,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 @@ -576,7 +574,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 @@ -588,7 +586,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 @@ -597,7 +595,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 @@ -748,7 +746,7 @@ 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}
While testing this series I found libvirt-daemon-common alone is not enough. virtqemud.service.in has Requires=virtlogd.socket Requires=virtlockd.socket So we'll need to add libvirt-daemon-lock and libvirt-daemon-log here, and where needed in the other hypervisor drivers. Or adjust the service files. Preferences? Regards, Jim
Requires: libvirt-libs = %{version}-%{release} Requires: /usr/bin/qemu-img # For image compression @@ -771,7 +769,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} @@ -791,7 +789,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 @@ -803,7 +801,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

On Tue, Jan 10, 2023 at 04:55:03PM -0700, Jim Fehlig wrote:
On 1/9/23 10:42, Jim Fehlig wrote:
%package daemon-driver-qemu Summary: QEMU driver plugin for the libvirtd daemon -Requires: libvirt-daemon = %{version}-%{release} +Requires: libvirt-daemon-common = %{version}-%{release}
While testing this series I found libvirt-daemon-common alone is not enough. virtqemud.service.in has
Requires=virtlogd.socket Requires=virtlockd.socket
So we'll need to add libvirt-daemon-lock and libvirt-daemon-log here, and where needed in the other hypervisor drivers. Or adjust the service files. Preferences?
Those were added in commit 88c5b9f827779ae6fe5a6f08100a4b6184492a1c Author: Daniel P. Berrangé <berrange@redhat.com> Date: Tue Aug 31 10:59:39 2021 +0100 qemu, xen: add missing deps on virtlockd/virtlogd sockets The QEMU driver uses both virtlogd and virtlockd, while the Xen driver uses virtlockd. The libvirtd.service unit contains deps on the socket units for these services, but these deps were missed in the modular daemons. As a result the virtlockd/virtlogd sockets are not started when the virtqemud/virtxend daemons are started. Reviewed-by: Jiri Denemark <jdenemar@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> I think we might need to weaken these relationship from Requires to Wants, as that should still ensure that the corresponding sockets are activated for standard deployments without making more specialized ones (e.g. without virtlockd) impossible. Similarly, I think we're missing Wants for virtstoraged.socket, virtnetworkd.socket, virtsecretd.socket and so on. Dan? -- Andrea Bolognani / Red Hat / Virtualization

On Wed, Jan 11, 2023 at 08:24:08AM -0800, Andrea Bolognani wrote:
On Tue, Jan 10, 2023 at 04:55:03PM -0700, Jim Fehlig wrote:
On 1/9/23 10:42, Jim Fehlig wrote:
%package daemon-driver-qemu Summary: QEMU driver plugin for the libvirtd daemon -Requires: libvirt-daemon = %{version}-%{release} +Requires: libvirt-daemon-common = %{version}-%{release}
While testing this series I found libvirt-daemon-common alone is not enough. virtqemud.service.in has
Requires=virtlogd.socket Requires=virtlockd.socket
So we'll need to add libvirt-daemon-lock and libvirt-daemon-log here, and where needed in the other hypervisor drivers. Or adjust the service files. Preferences?
Those were added in
commit 88c5b9f827779ae6fe5a6f08100a4b6184492a1c Author: Daniel P. Berrangé <berrange@redhat.com> Date: Tue Aug 31 10:59:39 2021 +0100
qemu, xen: add missing deps on virtlockd/virtlogd sockets
The QEMU driver uses both virtlogd and virtlockd, while the Xen driver uses virtlockd. The libvirtd.service unit contains deps on the socket units for these services, but these deps were missed in the modular daemons. As a result the virtlockd/virtlogd sockets are not started when the virtqemud/virtxend daemons are started.
Reviewed-by: Jiri Denemark <jdenemar@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
I think we might need to weaken these relationship from Requires to Wants, as that should still ensure that the corresponding sockets are activated for standard deployments without making more specialized ones (e.g. without virtlockd) impossible.
Weakening it to Wants means that virtqemud will still startup even if virtlogd fails to start. This is bogus because any attempt jto start a guest will then fail due to inability to connect to virtlogd's socket. Users trying to run in non-standard configurations can put in a systemd unit file override. They already need to edit the virtqemud configuration, so editting the unit file to match isn't a terrible burden.
Similarly, I think we're missing Wants for virtstoraged.socket, virtnetworkd.socket, virtsecretd.socket and so on.
We didn't bother with those since it is harmless either way. The distro unit file presets will configure those sockets to be started on boot if modular daemons are desired. If a user overrides this that's fine, we'll just fail to start a guest that has a config setting that requires them. 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 Wed, Jan 11, 2023 at 04:42:49PM +0000, Daniel P. Berrangé wrote:
On Wed, Jan 11, 2023 at 08:24:08AM -0800, Andrea Bolognani wrote:
I think we might need to weaken these relationship from Requires to Wants, as that should still ensure that the corresponding sockets are activated for standard deployments without making more specialized ones (e.g. without virtlockd) impossible.
Weakening it to Wants means that virtqemud will still startup even if virtlogd fails to start. This is bogus because any attempt jto start a guest will then fail due to inability to connect to virtlogd's socket.
Users trying to run in non-standard configurations can put in a systemd unit file override. They already need to edit the virtqemud configuration, so editting the unit file to match isn't a terrible burden.
I'm thinking of KubeVirt, which is the scenario I'm most familiar with, and in that case virtlogd is used but virtlockd isn't. Adding an override to remove the Requires=virtlockd.socket would indeed not be a big deal, but if we keep the relationships as they are then the libvirt-daemon-driver-qemu package needs to depend on the libvirt-daemon-driver-lock to keep it functional. So KubeVirt will not be able to avoid installing virtlockd despite not using it. The ironic part is that libvirt-daemon-driver-qemu doesn't depend on libvirt-daemon-plugin-lockd, so you will have virtlockd ready to go even while potentially missing the corresponding plugin! And, even better, also when you have configured storage locking, but have chosen the sanlock backend instead of the virtlockd one! Based on the fact that virtlogd is opt-out and virtlockd is opt-in, can we leave the Requires=virtlogd.socket relationship alone and add a dependency on libvirt-daemon-log to libvirt-daemon-driver-qemu, while at the same time demoting the Requires=virtlockd.socket to a Want and *not* adding a dependency on libvirt-daemon-lock?
Similarly, I think we're missing Wants for virtstoraged.socket, virtnetworkd.socket, virtsecretd.socket and so on.
We didn't bother with those since it is harmless either way. The distro unit file presets will configure those sockets to be started on boot if modular daemons are desired. If a user overrides this that's fine, we'll just fail to start a guest that has a config setting that requires them.
The same can be said of virtlockd. So I think we should either add all the missing Want relationships, or drop the one for virtlockd. -- Andrea Bolognani / Red Hat / Virtualization

On Wed, Jan 11, 2023 at 09:24:09AM -0800, Andrea Bolognani wrote:
On Wed, Jan 11, 2023 at 04:42:49PM +0000, Daniel P. Berrangé wrote:
On Wed, Jan 11, 2023 at 08:24:08AM -0800, Andrea Bolognani wrote:
I think we might need to weaken these relationship from Requires to Wants, as that should still ensure that the corresponding sockets are activated for standard deployments without making more specialized ones (e.g. without virtlockd) impossible.
Weakening it to Wants means that virtqemud will still startup even if virtlogd fails to start. This is bogus because any attempt jto start a guest will then fail due to inability to connect to virtlogd's socket.
Users trying to run in non-standard configurations can put in a systemd unit file override. They already need to edit the virtqemud configuration, so editting the unit file to match isn't a terrible burden.
I'm thinking of KubeVirt, which is the scenario I'm most familiar with, and in that case virtlogd is used but virtlockd isn't.
Adding an override to remove the Requires=virtlockd.socket would indeed not be a big deal, but if we keep the relationships as they are then the libvirt-daemon-driver-qemu package needs to depend on the libvirt-daemon-driver-lock to keep it functional. So KubeVirt will not be able to avoid installing virtlockd despite not using it.
The ironic part is that libvirt-daemon-driver-qemu doesn't depend on libvirt-daemon-plugin-lockd, so you will have virtlockd ready to go even while potentially missing the corresponding plugin! And, even better, also when you have configured storage locking, but have chosen the sanlock backend instead of the virtlockd one!
Based on the fact that virtlogd is opt-out and virtlockd is opt-in, can we leave the Requires=virtlogd.socket relationship alone and add a dependency on libvirt-daemon-log to libvirt-daemon-driver-qemu, while at the same time demoting the Requires=virtlockd.socket to a Want and *not* adding a dependency on libvirt-daemon-lock?
Yes, the virtlockd one is a bit inconsistent. Since we don't have it enabled by default, we don't need it as a Requires clause either.
Similarly, I think we're missing Wants for virtstoraged.socket, virtnetworkd.socket, virtsecretd.socket and so on.
We didn't bother with those since it is harmless either way. The distro unit file presets will configure those sockets to be started on boot if modular daemons are desired. If a user overrides this that's fine, we'll just fail to start a guest that has a config setting that requires them.
The same can be said of virtlockd. So I think we should either add all the missing Want relationships, or drop the one for virtlockd.
We need to fix the Fedora presets, since I notice we missed the virtlockd.socket / virtlogd.socket presets. This was harmless while a Requires existed. If we fix the presets, we can drop the virtlockd requires. 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 Wed, Jan 11, 2023 at 05:35:01PM +0000, Daniel P. Berrangé wrote:
On Wed, Jan 11, 2023 at 09:24:09AM -0800, Andrea Bolognani wrote:
Based on the fact that virtlogd is opt-out and virtlockd is opt-in, can we leave the Requires=virtlogd.socket relationship alone and add a dependency on libvirt-daemon-log to libvirt-daemon-driver-qemu, while at the same time demoting the Requires=virtlockd.socket to a Want and *not* adding a dependency on libvirt-daemon-lock?
Yes, the virtlockd one is a bit inconsistent. Since we don't have it enabled by default, we don't need it as a Requires clause either.
We need to fix the Fedora presets, since I notice we missed the virtlockd.socket / virtlogd.socket presets. This was harmless while a Requires existed. If we fix the presets, we can drop the virtlockd requires.
Sounds good! My only concern is compatibility with existing Fedora releases. Will the systemd preset update be rolled out to Fedora 36 and 37, or be limited to Rawhide and future releases? We need to consider RHEL and SUSE too. Should we keep relationship with virtlockd.socket for the time being, turning it from a Requires to a Wants, and only drop it once we are confident that the presets have been updated across the board? -- Andrea Bolognani / Red Hat / Virtualization

On 1/11/23 11:21, Andrea Bolognani wrote:
On Wed, Jan 11, 2023 at 05:35:01PM +0000, Daniel P. Berrangé wrote:
On Wed, Jan 11, 2023 at 09:24:09AM -0800, Andrea Bolognani wrote:
Based on the fact that virtlogd is opt-out and virtlockd is opt-in, can we leave the Requires=virtlogd.socket relationship alone and add a dependency on libvirt-daemon-log to libvirt-daemon-driver-qemu, while at the same time demoting the Requires=virtlockd.socket to a Want and *not* adding a dependency on libvirt-daemon-lock?
Yes, the virtlockd one is a bit inconsistent. Since we don't have it enabled by default, we don't need it as a Requires clause either.
We need to fix the Fedora presets, since I notice we missed the virtlockd.socket / virtlogd.socket presets. This was harmless while a Requires existed. If we fix the presets, we can drop the virtlockd requires.
Sounds good!
My only concern is compatibility with existing Fedora releases. Will the systemd preset update be rolled out to Fedora 36 and 37, or be limited to Rawhide and future releases? We need to consider RHEL and SUSE too.
AFAIK, there is nothing to consider for SUSE. None of the sockets/services are enabled by default on openSUSE. And ensuring correct presets based on the corresponding libvirt package structure should be easy in SLES.
Should we keep relationship with virtlockd.socket for the time being, turning it from a Requires to a Wants, and only drop it once we are confident that the presets have been updated across the board?
Can't the 'Wants=' stay, regardless of presets? FYI, I'm going to spin a V8 that splits this patch. Removing the libvirt-daemon dependency from the secondary drivers will remain here. The hypervisor drivers will be handled in a new patch, since they require additional tweaking. Regards, Jim

On Wed, Jan 11, 2023 at 02:11:13PM -0700, Jim Fehlig wrote:
On 1/11/23 11:21, Andrea Bolognani wrote:
Should we keep relationship with virtlockd.socket for the time being, turning it from a Requires to a Wants, and only drop it once we are confident that the presets have been updated across the board?
Can't the 'Wants=' stay, regardless of presets?
It's harmless to leave it there, but also unnecessary once presets have been adjusted. -- Andrea Bolognani / Red Hat / Virtualization

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 2cc77a2622..8c610d7797 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -815,7 +815,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} @@ -834,7 +842,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} @@ -853,7 +869,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} @@ -871,7 +892,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} @@ -890,7 +918,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

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 fecca64344..732fce59da 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -29,6 +29,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** -- 2.38.1
participants (3)
-
Andrea Bolognani
-
Daniel P. Berrangé
-
Jim Fehlig