[PATCH] rpm: disable sanlock when QEMU is disabled

Daniel P. Berrangé via Devel posted 1 patch 2 days, 8 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20251002141213.3013182-1-berrange@redhat.com
libvirt.spec.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH] rpm: disable sanlock when QEMU is disabled
Posted by Daniel P. Berrangé via Devel 2 days, 8 hours ago
From: Daniel P. Berrangé <berrange@redhat.com>

The meson.build rules skip sanlock when QEMU is disabled, so the RPM
must not try to create the -sanlock sub-RPM.

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 aff2707705..38928c7687 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:1}
+    %define with_sanlock 0%{!?_without_sanlock:%{with_qemu}?}
 %endif
 %if 0%{?rhel}
     %ifarch %{arches_qemu_kvm}
-        %define with_sanlock 0%{!?_without_sanlock:1}
+        %define with_sanlock 0%{!?_without_sanlock:%{with_qemu}}
     %endif
 %endif
 
-- 
2.50.1

Re: [PATCH] rpm: disable sanlock when QEMU is disabled
Posted by Martin Kletzander via Devel 1 day, 11 hours ago
On Thu, Oct 02, 2025 at 03:12:13PM +0100, Daniel P. Berrangé via Devel wrote:
>From: Daniel P. Berrangé <berrange@redhat.com>
>
>The meson.build rules skip sanlock when QEMU is disabled, so the RPM
>must not try to create the -sanlock sub-RPM.
>
>Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>

Reviewed-by: Martin Kletzander <mkletzan@redhat.com>

>---
> libvirt.spec.in | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/libvirt.spec.in b/libvirt.spec.in
>index aff2707705..38928c7687 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:1}
>+    %define with_sanlock 0%{!?_without_sanlock:%{with_qemu}?}
> %endif
> %if 0%{?rhel}
>     %ifarch %{arches_qemu_kvm}
>-        %define with_sanlock 0%{!?_without_sanlock:1}
>+        %define with_sanlock 0%{!?_without_sanlock:%{with_qemu}}
>     %endif
> %endif
>
>-- 
>2.50.1
>