[PATCH v2 0/2] Fix sanlock without qemu (dejavu)
My previous RPM fix was wrong, as sanlock can actually be used with libxl too. It is the meson rules that were wrong. Daniel P. Berrangé (2): Revert "rpm: disable sanlock when QEMU is disabled" locking: use & install test_libvirt_sanlock.sug for both QEMU & LibXL libvirt.spec.in | 4 ++-- src/locking/libvirt_sanlock.aug | 1 + src/locking/meson.build | 16 ++++++++-------- 3 files changed, 11 insertions(+), 10 deletions(-) -- 2.50.1
From: Daniel P. Berrangé <berrange@redhat.com> This reverts commit fefde6175884ff65241ddb3afae2d903df37e20e. The commit was mistaken, as sanlock is enabled for libxl too, however, the install of test_libvirt_sanlock.aug was missing when QEMU was disabled, causing the RPM build failure. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- libvirt.spec.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index f96fcc9d7b..aff2707705 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -149,11 +149,11 @@ # Enable sanlock library for lock management with QEMU # Sanlock is available only on arches where kvm is available for RHEL %if 0%{?fedora} - %define with_sanlock 0%{!?_without_sanlock:%{with_qemu}} + %define with_sanlock 0%{!?_without_sanlock:1} %endif %if 0%{?rhel} %ifarch %{arches_qemu_kvm} - %define with_sanlock 0%{!?_without_sanlock:%{with_qemu}} + %define with_sanlock 0%{!?_without_sanlock:1} %endif %endif -- 2.50.1
From: Daniel P. Berrangé <berrange@redhat.com> The RPM specfile was referencing test_libvirt_sanlock.aug in the common file list, for both QEMU and LibXL. This makes sense since the sanlock.conf file is cloned for both drivers. The libvirt_sanlock.aug file, however, was missing a reference to the LibXL copy of the config. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- src/locking/libvirt_sanlock.aug | 1 + src/locking/meson.build | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/locking/libvirt_sanlock.aug b/src/locking/libvirt_sanlock.aug index 184ea1f181..62d0672952 100644 --- a/src/locking/libvirt_sanlock.aug +++ b/src/locking/libvirt_sanlock.aug @@ -33,6 +33,7 @@ module Libvirt_sanlock = let lns = ( record | comment | empty ) * let filter = incl "/etc/libvirt/qemu-sanlock.conf" + . incl "/etc/libvirt/libxl-sanlock.conf" . Util.stdexcl let xfm = transform lns filter diff --git a/src/locking/meson.build b/src/locking/meson.build index 934e47593b..f8d12c481f 100644 --- a/src/locking/meson.build +++ b/src/locking/meson.build @@ -207,6 +207,14 @@ if conf.has('WITH_LIBVIRTD') if conf.has('WITH_SANLOCK') virt_aug_files += files('libvirt_sanlock.aug') + virt_test_aug_files += { + 'name': 'test_libvirt_sanlock.aug', + 'aug': files('test_libvirt_sanlock.aug.in'), + 'conf': files('sanlock.conf'), + 'test_name': 'libvirt_sanlock', + 'test_srcdir': meson.current_source_dir(), + 'test_builddir': meson.current_build_dir(), + } if conf.has('WITH_QEMU') qemu_sanlock_conf = configure_file( @@ -215,14 +223,6 @@ if conf.has('WITH_LIBVIRTD') configuration: configmake_conf, ) virt_conf_files += qemu_sanlock_conf - virt_test_aug_files += { - 'name': 'test_libvirt_sanlock.aug', - 'aug': files('test_libvirt_sanlock.aug.in'), - 'conf': qemu_sanlock_conf, - 'test_name': 'libvirt_sanlock', - 'test_srcdir': meson.current_source_dir(), - 'test_builddir': meson.current_build_dir(), - } endif if conf.has('WITH_LIBXL') -- 2.50.1
On Mon, Oct 06, 2025 at 12:17:30PM +0100, Daniel P. Berrangé via Devel wrote:
My previous RPM fix was wrong, as sanlock can actually be used with libxl too. It is the meson rules that were wrong.
I could've foresee this, but both your previous fix and Cole's patch together made sense... if blindly trusting our meson.build, which, it turns out, is not only source of the perfect truth O:-)
Daniel P. Berrangé (2): Revert "rpm: disable sanlock when QEMU is disabled" locking: use & install test_libvirt_sanlock.sug for both QEMU & LibXL
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
libvirt.spec.in | 4 ++-- src/locking/libvirt_sanlock.aug | 1 + src/locking/meson.build | 16 ++++++++-------- 3 files changed, 11 insertions(+), 10 deletions(-)
-- 2.50.1
participants (2)
-
Daniel P. Berrangé -
Martin Kletzander