# 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.
%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}
-Dqemu_datadir=%{qemu_datadir} \
-Dtls_priority=%{tls_priority} \
-Dsysctl_config=enabled \
- %{?arg_userfaultfd_sysctl} \
-Dssh_proxy=enabled \
%{?enable_werror} \
-Dexpensive_tests=enabled \
-Dstorage_vstorage=disabled \
-Dstorage_zfs=disabled \
-Dsysctl_config=disabled \
- -Duserfaultfd_sysctl=disabled \
-Dssh_proxy=disabled \
-Dtests=disabled \
-Dudev=disabled \
%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
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
'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,
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')
'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',
+++ /dev/null
-# 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