[PATCH 0/2] storage: Don't require 'showmount' at configure time and weaken dependency on RPM distros

See individual patches. Peter Krempa (2): storage: fs: Remove build-time detection of 'showmount' program spec: Demote 'nfs-utils' as a weak dependency of 'daemon-driver-storage-core' libvirt.spec.in | 4 +--- meson.build | 7 ------- src/storage/storage_backend_fs.c | 2 +- 3 files changed, 2 insertions(+), 11 deletions(-) -- 2.46.0

With the new virCommand infrastructure which can find the program in path automatically we no longer need the build-time detection. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- libvirt.spec.in | 2 -- meson.build | 7 ------- src/storage/storage_backend_fs.c | 2 +- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 29101e74fe..7e421898f6 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -429,8 +429,6 @@ BuildRequires: audit-libs-devel BuildRequires: systemtap-sdt-devel # For mount/umount in FS driver BuildRequires: util-linux -# For showmount in FS driver (netfs discovery) -BuildRequires: nfs-utils %if %{with_numad} BuildRequires: numad %endif diff --git a/meson.build b/meson.build index eb4b608e85..297fbfae48 100644 --- a/meson.build +++ b/meson.build @@ -1855,13 +1855,6 @@ if conf.has('WITH_LIBVIRTD') conf.set_quoted('MOUNT', mount_prog.full_path()) conf.set_quoted('UMOUNT', umount_prog.full_path()) conf.set_quoted('MKFS', mkfs_prog.full_path()) - - showmount_prog = find_program('showmount', required: false, dirs: libvirt_sbin_path) - showmount_path = '' - if showmount_prog.found() - showmount_path = showmount_prog.full_path() - endif - conf.set_quoted('SHOWMOUNT', showmount_path) endif endif diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c index 1851704d21..fce395d60f 100644 --- a/src/storage/storage_backend_fs.c +++ b/src/storage/storage_backend_fs.c @@ -106,7 +106,7 @@ virStorageBackendFileSystemNetFindNFSPoolSources(virNetfsDiscoverState *state) g_autoptr(virCommand) cmd = NULL; - cmd = virCommandNewArgList(SHOWMOUNT, + cmd = virCommandNewArgList("showmount", "--no-headers", "--exports", state->host, -- 2.46.0

The 'nfs-utils' package provides 'showmount' used to detect NFS-based storage pool sources. As the lookup of storage pool sources can fail gracefully and does so e.g. if the gluster backend is not installed we can do the same for NFS. Apart from allowing a tighter footprint when installing libvirt, this also allows installation of the storage driver core in cases when a security policy prohibits use of NFS. Resolves: https://issues.redhat.com/browse/RHEL-56611 Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- libvirt.spec.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 7e421898f6..4d6a1d268f 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -667,7 +667,7 @@ an implementation of the secret key APIs. Summary: Storage driver plugin including base backends for the libvirtd daemon Requires: libvirt-daemon-common = %{version}-%{release} Requires: libvirt-libs = %{version}-%{release} -Requires: nfs-utils +Recommends: nfs-utils # For mkfs Requires: util-linux # For storage wiping with different algorithms -- 2.46.0

On Mon, Sep 02, 2024 at 02:56:42PM +0200, Peter Krempa wrote:
See individual patches.
Peter Krempa (2): storage: fs: Remove build-time detection of 'showmount' program spec: Demote 'nfs-utils' as a weak dependency of 'daemon-driver-storage-core'
libvirt.spec.in | 4 +--- meson.build | 7 ------- src/storage/storage_backend_fs.c | 2 +- 3 files changed, 2 insertions(+), 11 deletions(-)
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
participants (2)
-
Pavel Hrdina
-
Peter Krempa