From f1c8c9a1e81f477f494859eeafddd03a0296b2c0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A1n=20Tomko?= Date: Wed, 19 Nov 2025 12:00:12 +0100 Subject: [PATCH] build: drop userfaultfd_sysctl option MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Martin Kletzander --- libvirt.spec.in | 18 ------------------ meson.build | 7 ------- meson_options.txt | 2 -- src/qemu/meson.build | 8 -------- src/qemu/postcopy-migration.sysctl | 6 ------ 5 files changed, 41 deletions(-) delete mode 100644 src/qemu/postcopy-migration.sysctl diff --git a/libvirt.spec.in b/libvirt.spec.in index 79738bd7bb..8314fbeb34 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -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 @@ -259,12 +258,6 @@ %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 diff --git a/meson.build b/meson.build index c1871de64c..6ac9d01952 100644 --- a/meson.build +++ b/meson.build @@ -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, diff --git a/meson_options.txt b/meson_options.txt index 8b6b26dfc6..e12ace4e11 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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') diff --git a/src/qemu/meson.build b/src/qemu/meson.build index 5cf20f426f..ff9a904277 100644 --- a/src/qemu/meson.build +++ b/src/qemu/meson.build @@ -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 index db3f11e49f..0000000000 --- a/src/qemu/postcopy-migration.sysctl +++ /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 -- 2.47.3