On Fri, Dec 02, 2022 at 05:17:36PM -0700, Jim Fehlig wrote:
Move virt-admin, virt-host-validate, virt-ssh-helper, and
libvirt-guests
to a new libvirt-daemon-client subpackage.
These tools aren't really clients in general - only vuirt-admin is
a client. virt-host-validate is a host configuration validation
tool, while virt-ssh-helper is a helper tool for incoming
connections.
We could say libvirt-daemon-tools, but I'm a wondering if it is
sufficient to have them in a libvirt-daemon-common package. With
virt-admin in particular we really wanted it to always be present
in any install with the daemons, as a key debugging/admin aid.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
libvirt.spec.in | 68 +++++++++++++++++++++++++++++--------------------
1 file changed, 40 insertions(+), 28 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index d5243e859b..381f74c222 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -440,17 +440,12 @@ 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-client = %{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,
-# 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
@@ -480,6 +475,21 @@ Requires: numad
Requires: dbus
# For uid creation during pre
Requires(pre): shadow-utils
+
+%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-client
+Summary: Miscellaneous utilities
+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}
+
# Needed by /usr/libexec/libvirt-guests.sh script.
%if 0%{?fedora} >= 37
Requires: gettext-runtime
@@ -492,10 +502,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-client
+Miscellaneous utilities for use with other libvirt daemons
%package daemon-lock
Summary: Server side daemon for managing locks
@@ -1464,7 +1472,7 @@ 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_sysconfig_pre libvirtd
# '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.
@@ -1476,22 +1484,13 @@ exit 0
%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
@@ -1526,6 +1525,22 @@ fi
%libvirt_daemon_finish_restart libvirtd
+%pre daemon-client
+%libvirt_sysconfig_pre libvirt-guests
+
+%post daemon-client
+%systemd_post libvirt-guests.service
+
+%preun daemon-client
+%systemd_preun libvirt-guests.service
+
+%postun daemon-client
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+%systemd_postun libvirt-guests.service
+
+%posttrans daemon-client
+%libvirt_sysconfig_posttrans libvirt-guests
+
%pre daemon-lock
%libvirt_sysconfig_pre virtlockd
@@ -1855,7 +1870,6 @@ exit 0
%{_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
@@ -1883,20 +1897,18 @@ exit 0
%{_datadir}/polkit-1/rules.d/50-libvirt.rules
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/
+%attr(0755, root, root) %{_sbindir}/libvirtd
+%{_mandir}/man8/libvirtd.8*
+%files daemon-client
+%{_unitdir}/libvirt-guests.service
%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
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 :|