]> xenbits.xensource.com Git - people/aperard/libvirt.git/commitdiff
libvirt.spec: Fix nbdkit selection logic on mingw and old rhel
authorPeter Krempa <pkrempa@redhat.com>
Fri, 5 Jan 2024 08:39:45 +0000 (09:39 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 5 Jan 2024 10:08:41 +0000 (11:08 +0100)
rhel-8 lacks 'pidfd_open()' support and thus nbdkit can't be enabled
there.

mingw builds explicitly disable nbdkit support, but use
'--auto-features=enabled' thus omitting setting of
'nbdkit_config_default' results in meson thinking we want to enable it:

  ../meson.build:1018:2: ERROR: Problem encountered: nbdkit_config_default requires nbdkit to be enabled

Disable it explicitly. The meson logic might need to be fixed eventually
when switching it on by default.

Fixes: 9eabf14afbd429af1be195723fdeab5ccdd0b2cd
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
libvirt.spec.in

index 2f2d7137324c97acc8823f209a652a565801345c..8413e3c19a5b4fdf06324689e15e32862dc5c0f5 100644 (file)
 # default if the OS ships a SELinux policy that allows libvirt to launch it.
 # Right now that's not the case anywhere, but things should be fine by the time
 # Fedora 40 is released.
-#
-# TODO: add RHEL 9 once a minor release that contains the necessary SELinux
-#       bits exists (we only support the most recent minor release)
 %if %{with_qemu}
-    %define with_nbdkit 0%{!?_without_nbdkit:1}
-    %if 0%{?fedora} >= 40
-        %define with_nbdkit_config_default 0%{!?_without_nbdkit_config_default:1}
+    # rhel-8 lacks pidfd_open
+    %if 0%{?fedora} || 0%{?rhel} >= 9
+        %define with_nbdkit 0%{!?_without_nbdkit:1}
+
+        # setting 'with_nbdkit_config_default' must be done only when compiling
+        # in nbdkit support
+        #
+        # TODO: add RHEL 9 once a minor release that contains the necessary SELinux
+        #       bits exists (we only support the most recent minor release)
+        %if 0%{?fedora} >= 40
+            %define with_nbdkit_config_default 0%{!?_without_nbdkit_config_default:1}
+        %endif
     %endif
 %endif
 
@@ -1397,6 +1403,7 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec)
   -Dhost_validate=disabled \
   -Dlibiscsi=disabled \
   -Dnbdkit=disabled \
+  -Dnbdkit_config_default=disabled \
   -Dlibnl=disabled \
   -Dlibpcap=disabled \
   -Dlibssh2=disabled \