]> xenbits.xensource.com Git - libvirt.git/commitdiff
build: Add userfaultfd_sysctl build option
authorJiri Denemark <jdenemar@redhat.com>
Fri, 9 Feb 2024 14:20:58 +0000 (15:20 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Tue, 13 Feb 2024 16:44:26 +0000 (17:44 +0100)
This option controls whether the sysctl config for enabling unprivileged
userfaultfd will be installed.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
meson.build
meson_options.txt
src/qemu/meson.build

index e1c70fce92d5eec2fa8c0f3cd058bbc291dd89f5..dbd9cad6df5ab0292f877e0b6f29cd463fd7bd94 100644 (file)
@@ -2019,6 +2019,12 @@ 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
+
 conf.set_quoted('TLS_PRIORITY', get_option('tls_priority'))
 
 
@@ -2318,6 +2324,8 @@ misc_summary = {
   'virt-login-shell': conf.has('WITH_LOGIN_SHELL'),
   'virt-host-validate': conf.has('WITH_HOST_VALIDATE'),
   'TLS priority': conf.get_unquoted('TLS_PRIORITY'),
+  'sysctl config': conf.has('WITH_SYSCTL'),
+  'userfaultfd sysctl': conf.has('WITH_USERFAULTFD_SYSCTL'),
 }
 summary(misc_summary, section: 'Miscellaneous', bool_yn: true, list_sep: ' ')
 
index 182e28b3d15261cf29318c1f3ea2da7ad79c6a1e..ed91d97abfcfe0853f2825960ea308978784aa5f 100644 (file)
@@ -108,4 +108,5 @@ option('nbdkit', type: 'feature', value: 'auto', description: 'Build nbdkit stor
 option('nbdkit_config_default', type: 'feature', value: 'auto', description: 'Whether to use nbdkit storage backend for network disks by default (configurable)')
 option('pm_utils', type: 'feature', value: 'auto', description: 'use pm-utils for power management')
 option('sysctl_config', type: 'feature', value: 'auto', description: 'Whether to install sysctl configs')
+option('userfaultfd_sysctl', type: 'feature', value: 'auto', description: 'Whether to install sysctl config for enabling unprivileged userfaultfd')
 option('tls_priority', type: 'string', value: 'NORMAL', description: 'set the default TLS session priority string')
index 7a0e908a669be086e12023b3ee1a2bc075b91e22..907893d431408885b699419ecf3a3fa5a357d064 100644 (file)
@@ -209,7 +209,7 @@ if conf.has('WITH_QEMU')
     'in_file': files('virtqemud.init.in'),
   }
 
-  if conf.has('WITH_SYSCTL')
+  if conf.has('WITH_USERFAULTFD_SYSCTL')
     install_data(
       'postcopy-migration.sysctl',
       install_dir: prefix / 'lib' / 'sysctl.d',