[PATCH V2 4/9] spec: Move lockd plugin to a new subpackage

Jim Fehlig posted 9 patches 3 years, 1 month ago
There is a newer version of this series
[PATCH V2 4/9] spec: Move lockd plugin to a new subpackage
Posted by Jim Fehlig 3 years, 1 month ago
Introduce the libvirt-daemon-plugin-lockd subpackage to provide the
client-side lockd plugin for virtlockd.

The sanlock plugin also needs the directory %{_libdir}/libvirt/lock-driver,
which it currently gets via the libvirt-daemon dependency. Duplicate the
directory in the %files section of the sanlock plugin, allowing the
libvirt-daemon dependency to be dropped.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
---
 libvirt.spec.in | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/libvirt.spec.in b/libvirt.spec.in
index 633cf05100..63b29ba6f4 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,
@@ -488,6 +489,13 @@ 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}
+
+%description daemon-plugin-lockd
+A client-side plugin for virtlockd that implements locking using POSIX fcntl advisory locks
+
 %package daemon-log
 Summary: Server side daemon for managing logs
 Requires: libvirt-libs = %{version}-%{release}
@@ -951,7 +959,6 @@ 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}
 
 %description lock-sanlock
@@ -1812,8 +1819,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
-%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
@@ -1847,6 +1852,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
@@ -2154,6 +2163,7 @@ exit 0
     %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
Re: [PATCH V2 4/9] spec: Move lockd plugin to a new subpackage
Posted by Daniel P. Berrangé 3 years, 1 month ago
On Tue, Dec 13, 2022 at 05:30:57PM -0700, Jim Fehlig wrote:
> Introduce the libvirt-daemon-plugin-lockd subpackage to provide the
> client-side lockd plugin for virtlockd.
> 
> The sanlock plugin also needs the directory %{_libdir}/libvirt/lock-driver,
> which it currently gets via the libvirt-daemon dependency. Duplicate the
> directory in the %files section of the sanlock plugin, allowing the
> libvirt-daemon dependency to be dropped.
> 
> Signed-off-by: Jim Fehlig <jfehlig@suse.com>
> ---
>  libvirt.spec.in | 16 +++++++++++++---
>  1 file changed, 13 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 :|

Re: [PATCH V2 4/9] spec: Move lockd plugin to a new subpackage
Posted by Andrea Bolognani 3 years, 1 month ago
On Tue, Dec 13, 2022 at 05:30:57PM -0700, Jim Fehlig wrote:
> Introduce the libvirt-daemon-plugin-lockd subpackage to provide the
> client-side lockd plugin for virtlockd.
>
> The sanlock plugin also needs the directory %{_libdir}/libvirt/lock-driver,
> which it currently gets via the libvirt-daemon dependency. Duplicate the
> directory in the %files section of the sanlock plugin, allowing the
> libvirt-daemon dependency to be dropped.

I think it would be slightly neater if you introduced the new package
with a dependency on libvirt-daemon and left the existing dependency
in the sanlock package alone. Then, after introducing the
libvirt-daemon-common package, you could replace those dependencies
with the more lightweight ones at the same time as you're doing so
for all other packages.

> +%package daemon-plugin-lockd
> +Summary: lockd client plugin for virtlockd
> +Requires: libvirt-libs = %{version}-%{release}

I think you should have a dependency on libvirt-daemon-lock here,
since the lockd.so plugin requires virtlockd in order to work.

-- 
Andrea Bolognani / Red Hat / Virtualization
Re: [PATCH V2 4/9] spec: Move lockd plugin to a new subpackage
Posted by Jim Fehlig 3 years, 1 month ago
On 12/14/22 10:47, Andrea Bolognani wrote:
> On Tue, Dec 13, 2022 at 05:30:57PM -0700, Jim Fehlig wrote:
>> Introduce the libvirt-daemon-plugin-lockd subpackage to provide the
>> client-side lockd plugin for virtlockd.
>>
>> The sanlock plugin also needs the directory %{_libdir}/libvirt/lock-driver,
>> which it currently gets via the libvirt-daemon dependency. Duplicate the
>> directory in the %files section of the sanlock plugin, allowing the
>> libvirt-daemon dependency to be dropped.
> 
> I think it would be slightly neater if you introduced the new package
> with a dependency on libvirt-daemon and left the existing dependency
> in the sanlock package alone. Then, after introducing the
> libvirt-daemon-common package, you could replace those dependencies
> with the more lightweight ones at the same time as you're doing so
> for all other packages.

That patch starts with libvirt-daemon getting a dependency on 
libvirt-daemon-plugin-lockd :-). That dependency is needed to ensure we still 
get lockd.so when installing libvirt-daemon.

What if I leave the directory in libvirt-daemon in this patch, then duplicate it 
and drop the libvirt-daemon dependency when renaming the sanlock package?

Regards,
Jim