]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
build: drop userfaultfd_sysctl option
authorJán Tomko <jtomko@redhat.com>
Wed, 19 Nov 2025 11:00:12 +0000 (12:00 +0100)
committerJán Tomko <jtomko@redhat.com>
Thu, 20 Nov 2025 22:32:08 +0000 (23:32 +0100)
Since e2bc742fcc64da4c8370a71b65fd8c01ff3f9d41 we do not
install it on RHEL nor Fedora.

OpenSUSE is also new enough that it disables the installation.
On Debian, sysctl files are only installed as an example.

Remove the option and delete the file.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
libvirt.spec.in
meson.build
meson_options.txt
src/qemu/meson.build
src/qemu/postcopy-migration.sysctl [deleted file]

index 79738bd7bb34d7feb4d18735197e693cb8026237..8314fbeb348baaf012e943e21348418e526c5e4d 100644 (file)
@@ -91,7 +91,6 @@
 
 # Other optional features
 %define with_numactl          0%{!?_without_numactl:1}
-%define with_userfaultfd_sysctl 0%{!?_without_userfaultfd_sysctl:1}
 
 # A few optional bits off by default, we enable later
 %define with_fuse             0
     %define enable_werror -Dwerror=false -Dgit_werror=disabled
 %endif
 
-# Fedora and RHEL-9 are new enough to support /dev/userfaultfd, which
-# does not require enabling vm.unprivileged_userfaultfd sysctl.
-%if 0%{?fedora} || 0%{?rhel}
-    %define with_userfaultfd_sysctl 0
-%endif
-
 %define tls_priority "@LIBVIRT,SYSTEM"
 
 # libvirt 8.1.0 stops distributing any sysconfig files.
@@ -1329,12 +1322,6 @@ exit 1
     %define arg_remote_mode -Dremote_default_mode=legacy
 %endif
 
-%if %{with_userfaultfd_sysctl}
-    %define arg_userfaultfd_sysctl -Duserfaultfd_sysctl=enabled
-%else
-    %define arg_userfaultfd_sysctl -Duserfaultfd_sysctl=disabled
-%endif
-
 %define when  %(date +"%%F-%%T")
 %define where %(hostname)
 %define who   %{?packager}%{!?packager:Unknown}
@@ -1418,7 +1405,6 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec)
            -Dqemu_datadir=%{qemu_datadir} \
            -Dtls_priority=%{tls_priority} \
            -Dsysctl_config=enabled \
-           %{?arg_userfaultfd_sysctl} \
            -Dssh_proxy=enabled \
            %{?enable_werror} \
            -Dexpensive_tests=enabled \
@@ -1506,7 +1492,6 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec)
   -Dstorage_vstorage=disabled \
   -Dstorage_zfs=disabled \
   -Dsysctl_config=disabled \
-  -Duserfaultfd_sysctl=disabled \
   -Dssh_proxy=disabled \
   -Dtests=disabled \
   -Dudev=disabled \
@@ -2314,9 +2299,6 @@ exit 0
     %if %{with_qemu}
 %files daemon-driver-qemu
 %config(noreplace) %{_sysconfdir}/libvirt/virtqemud.conf
-        %if %{with_userfaultfd_sysctl}
-%config(noreplace) %{_prefix}/lib/sysctl.d/60-qemu-postcopy-migration.conf
-        %endif
 %{_datadir}/augeas/lenses/virtqemud.aug
 %{_datadir}/augeas/lenses/tests/test_virtqemud.aug
 %{_unitdir}/virtqemud.service
index c1871de64c7510b1672b8f31bdcd201a4e7ab7c4..6ac9d01952d093739222938810447c2f70441f11 100644 (file)
@@ -2029,12 +2029,6 @@ elif get_option('sysctl_config').enabled()
   error('sysctl configuration is supported only on linux')
 endif
 
-if not get_option('userfaultfd_sysctl').disabled() and conf.has('WITH_SYSCTL')
-  conf.set('WITH_USERFAULTFD_SYSCTL', 1)
-elif get_option('userfaultfd_sysctl').enabled()
-  error('userfaultfd_sysctl option requires sysctl_config to be enabled')
-endif
-
 prio = get_option('tls_priority')
 if prio == 'auto'
     # If local OS has 'crypto-policies' then default to that
@@ -2345,7 +2339,6 @@ misc_summary = {
   'sysctl config': conf.has('WITH_SYSCTL'),
   'tests': tests_enabled,
   'TLS priority': conf.get_unquoted('TLS_PRIORITY'),
-  'userfaultfd sysctl': conf.has('WITH_USERFAULTFD_SYSCTL'),
   'virt-host-validate': conf.has('WITH_HOST_VALIDATE'),
   'virt-login-shell': conf.has('WITH_LOGIN_SHELL'),
   'Warning Flags': supported_cc_flags,
index 8b6b26dfc6c1e32a9a4f938129c51c6a3337affb..e12ace4e115a79078c53e587017a035377f88c43 100644 (file)
@@ -132,6 +132,4 @@ option('nbdkit_config_default', type: 'feature', value: 'auto', description: 'Wh
 option('pm_utils', type: 'feature', value: 'auto', description: 'use pm-utils for power management')
 option('ssh_proxy', type: 'feature', value: 'auto', description: 'Build ssh-proxy for ssh over vsock')
 option('sysctl_config', type: 'feature', value: 'auto', description: 'Whether to install sysctl configs')
-# dep:sysctl_config
-option('userfaultfd_sysctl', type: 'feature', value: 'auto', description: 'Whether to install sysctl config for enabling unprivileged userfaultfd')
 option('tls_priority', type: 'string', value: 'auto', description: 'set the default TLS session priority string')
index 5cf20f426fe330257af0a22b96c65135e38580fe..ff9a90427798cfafa7c964b3fdc99c0ceae4c0c8 100644 (file)
@@ -210,14 +210,6 @@ if conf.has('WITH_QEMU')
     'in_file': files('virtqemud.init.in'),
   }
 
-  if conf.has('WITH_USERFAULTFD_SYSCTL')
-    install_data(
-      'postcopy-migration.sysctl',
-      install_dir: prefix / 'lib' / 'sysctl.d',
-      rename: [ '60-qemu-postcopy-migration.conf' ],
-    )
-  endif
-
   virt_install_dirs += [
     confdir / 'qemu',
     confdir / 'qemu' / 'autostart',
diff --git a/src/qemu/postcopy-migration.sysctl b/src/qemu/postcopy-migration.sysctl
deleted file mode 100644 (file)
index db3f11e..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-# This is needed to support post-copy migration for QEMU run by libvirt,
-# i.e., unprivileged, as userfaultfd is by default only available to
-# privileged processes.
-# It can be safely overridden by a file in /etc/sysctl.d/ in case post-copy
-# migration is not used on the host.
--vm.unprivileged_userfaultfd = 1