* More Meson conversions (0.59.x now required rather than suggested)

* UMIP support for TCG x86
 * Fix migration crash
 * Restore error output for check-block
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmITXP8UHHBib256aW5p
 QHJlZGhhdC5jb20ACgkQv/vSX3jHroOsdQf/Srx+8BImb+LtRpiKHhn4SiucGSe8
 EhEAPSnblbvIGK9BYfj953svDzlLN2JIADcmOI59QE2xsPEtxLlEmMlvg/JIUMQp
 jk07oxbVXdv4olTyECmO3hj2VbSG7VR3tP9TOuJA5Vi4a+VzYXc6zv1/mp/8rdnl
 pGW0pjBZTXSp2Z/Be9/aGN8IuW+GnQuVZDXWBuEJmz2UzcdPWaOUVDro7IaUXmqp
 eB4XcT0jPR5uKetA1R1cyHCUVd7P0v6UV8SLYj905H1a8sqxDWMiUzX6fKkoN0SJ
 r/y7kCuyNzpxoWRuA2KN6Q5f9kAlMI/j9H3ih0wUfEkauiPtTATAc1+s+Q==
 =sSBY
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into staging

* More Meson conversions (0.59.x now required rather than suggested)
* UMIP support for TCG x86
* Fix migration crash
* Restore error output for check-block

# gpg: Signature made Mon 21 Feb 2022 09:35:59 GMT
# gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
# gpg:                issuer "pbonzini@redhat.com"
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full]
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>" [full]
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* remotes/bonzini-gitlab/tags/for-upstream: (29 commits)
  configure, meson: move CONFIG_IASL to a Meson option
  meson, configure: move ntddscsi API check to meson
  meson: require dynamic linking for VSS support
  qga/vss-win32: require widl/midl, remove pre-built TLB file
  meson: do not make qga/vss-win32/meson.build conditional on C++ presence
  configure, meson: replace VSS SDK checks and options with --enable-vss-sdk
  qga/vss: use standard windows headers location
  qga/vss-win32: use widl if available
  meson: drop --with-win-sdk
  qga/vss-win32: fix midl arguments
  meson: refine check for whether to look for virglrenderer
  configure, meson: move guest-agent, tools to meson
  configure, meson: move smbd options to meson_options.txt
  configure, meson: move coroutine options to meson_options.txt
  configure, meson: move some default-disabled options to meson_options.txt
  meson: define qemu_cflags/qemu_ldflags
  configure, meson: move block layer options to meson_options.txt
  configure, meson: move image format options to meson_options.txt
  configure, meson: cleanup qemu-ga libraries
  configure, meson: move TPM check to meson
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2022-02-21 17:24:05 +00:00
commit 922268067f
36 changed files with 690 additions and 878 deletions

View File

@ -1,8 +1,6 @@
tpm_ss = ss.source_set() if have_tpm
softmmu_ss.add(files('tpm_backend.c'))
tpm_ss.add(files('tpm_backend.c')) softmmu_ss.add(files('tpm_util.c'))
tpm_ss.add(files('tpm_util.c')) softmmu_ss.add(when: 'CONFIG_TPM_PASSTHROUGH', if_true: files('tpm_passthrough.c'))
tpm_ss.add(when: 'CONFIG_TPM_PASSTHROUGH', if_true: files('tpm_passthrough.c')) softmmu_ss.add(when: 'CONFIG_TPM_EMULATOR', if_true: files('tpm_emulator.c'))
tpm_ss.add(when: 'CONFIG_TPM_EMULATOR', if_true: files('tpm_emulator.c')) endif
softmmu_ss.add_all(when: 'CONFIG_TPM', if_true: tpm_ss)

View File

@ -45,25 +45,44 @@ block_ss.add(files(
softmmu_ss.add(when: 'CONFIG_TCG', if_true: files('blkreplay.c')) softmmu_ss.add(when: 'CONFIG_TCG', if_true: files('blkreplay.c'))
block_ss.add(when: 'CONFIG_QCOW1', if_true: files('qcow.c')) if get_option('qcow1').allowed()
block_ss.add(when: 'CONFIG_VDI', if_true: files('vdi.c')) block_ss.add(files('qcow.c'))
block_ss.add(when: 'CONFIG_CLOOP', if_true: files('cloop.c')) endif
block_ss.add(when: 'CONFIG_BOCHS', if_true: files('bochs.c')) if get_option('vdi').allowed()
block_ss.add(when: 'CONFIG_VVFAT', if_true: files('vvfat.c')) block_ss.add(files('vdi.c'))
block_ss.add(when: 'CONFIG_DMG', if_true: files('dmg.c')) endif
block_ss.add(when: 'CONFIG_QED', if_true: files( if get_option('cloop').allowed()
'qed-check.c', block_ss.add(files('cloop.c'))
'qed-cluster.c', endif
'qed-l2-cache.c', if get_option('bochs').allowed()
'qed-table.c', block_ss.add(files('bochs.c'))
'qed.c', endif
)) if get_option('vvfat').allowed()
block_ss.add(when: 'CONFIG_PARALLELS', if_true: files('parallels.c', 'parallels-ext.c')) block_ss.add(files('vvfat.c'))
endif
if get_option('dmg').allowed()
block_ss.add(files('dmg.c'))
endif
if get_option('qed').allowed()
block_ss.add(files(
'qed-check.c',
'qed-cluster.c',
'qed-l2-cache.c',
'qed-table.c',
'qed.c',
))
endif
if get_option('parallels').allowed()
block_ss.add(files('parallels.c', 'parallels-ext.c'))
endif
block_ss.add(when: 'CONFIG_WIN32', if_true: files('file-win32.c', 'win32-aio.c')) block_ss.add(when: 'CONFIG_WIN32', if_true: files('file-win32.c', 'win32-aio.c'))
block_ss.add(when: 'CONFIG_POSIX', if_true: [files('file-posix.c'), coref, iokit]) block_ss.add(when: 'CONFIG_POSIX', if_true: [files('file-posix.c'), coref, iokit])
block_ss.add(when: libiscsi, if_true: files('iscsi-opts.c')) block_ss.add(when: libiscsi, if_true: files('iscsi-opts.c'))
block_ss.add(when: 'CONFIG_LINUX', if_true: files('nvme.c')) block_ss.add(when: 'CONFIG_LINUX', if_true: files('nvme.c'))
block_ss.add(when: 'CONFIG_REPLICATION', if_true: files('replication.c')) if not get_option('replication').disabled()
block_ss.add(files('replication.c'))
endif
block_ss.add(when: libaio, if_true: files('linux-aio.c')) block_ss.add(when: libaio, if_true: files('linux-aio.c'))
block_ss.add(when: linux_io_uring, if_true: files('io_uring.c')) block_ss.add(when: linux_io_uring, if_true: files('io_uring.c'))
@ -89,7 +108,7 @@ foreach m : [
endforeach endforeach
# those are not exactly regular block modules, so treat them apart # those are not exactly regular block modules, so treat them apart
if 'CONFIG_DMG' in config_host if get_option('dmg').allowed()
foreach m : [ foreach m : [
[liblzfse, 'dmg-lzfse', liblzfse, 'dmg-lzfse.c'], [liblzfse, 'dmg-lzfse', liblzfse, 'dmg-lzfse.c'],
[libbzip2, 'dmg-bz2', [glib, libbzip2], 'dmg-bz2.c'] [libbzip2, 'dmg-bz2', [glib, libbzip2], 'dmg-bz2.c']

598
configure vendored
View File

@ -238,9 +238,7 @@ cross_prefix=""
audio_drv_list="default" audio_drv_list="default"
block_drv_rw_whitelist="" block_drv_rw_whitelist=""
block_drv_ro_whitelist="" block_drv_ro_whitelist=""
block_drv_whitelist_tools="no"
host_cc="cc" host_cc="cc"
libs_qga=""
debug_info="yes" debug_info="yes"
lto="false" lto="false"
stack_protector="" stack_protector=""
@ -290,7 +288,6 @@ EXTRA_CXXFLAGS=""
EXTRA_LDFLAGS="" EXTRA_LDFLAGS=""
xen_ctrl_version="$default_feature" xen_ctrl_version="$default_feature"
membarrier="$default_feature"
vhost_kernel="$default_feature" vhost_kernel="$default_feature"
vhost_net="$default_feature" vhost_net="$default_feature"
vhost_crypto="$default_feature" vhost_crypto="$default_feature"
@ -301,7 +298,6 @@ vhost_user_fs="$default_feature"
vhost_vdpa="$default_feature" vhost_vdpa="$default_feature"
rdma="$default_feature" rdma="$default_feature"
pvrdma="$default_feature" pvrdma="$default_feature"
gprof="no"
debug_tcg="no" debug_tcg="no"
debug="no" debug="no"
sanitizers="no" sanitizers="no"
@ -313,49 +309,23 @@ modules="no"
module_upgrades="no" module_upgrades="no"
prefix="/usr/local" prefix="/usr/local"
qemu_suffix="qemu" qemu_suffix="qemu"
profiler="no"
softmmu="yes" softmmu="yes"
linux_user="" linux_user=""
bsd_user="" bsd_user=""
pkgversion="" pkgversion=""
pie="" pie=""
qom_cast_debug="yes"
trace_backends="log" trace_backends="log"
trace_file="trace" trace_file="trace"
opengl="$default_feature" opengl="$default_feature"
cpuid_h="no"
avx2_opt="$default_feature"
guest_agent="$default_feature"
vss_win32_sdk="$default_feature"
win_sdk="no"
want_tools="$default_feature"
coroutine="" coroutine=""
coroutine_pool="$default_feature"
debug_stack_usage="no"
crypto_afalg="no"
tls_priority="NORMAL" tls_priority="NORMAL"
tpm="$default_feature"
live_block_migration=${default_feature:-yes}
numa="$default_feature"
replication=${default_feature:-yes}
bochs=${default_feature:-yes}
cloop=${default_feature:-yes}
dmg=${default_feature:-yes}
qcow1=${default_feature:-yes}
vdi=${default_feature:-yes}
vvfat=${default_feature:-yes}
qed=${default_feature:-yes}
parallels=${default_feature:-yes}
debug_mutex="no"
plugins="$default_feature" plugins="$default_feature"
rng_none="no"
secret_keyring="$default_feature" secret_keyring="$default_feature"
meson="" meson=""
meson_args="" meson_args=""
ninja="" ninja=""
gio="$default_feature" gio="$default_feature"
skip_meson=no skip_meson=no
slirp_smbd="$default_feature"
# The following Meson options are handled manually (still they # The following Meson options are handled manually (still they
# are included in the automatically generated help message) # are included in the automatically generated help message)
@ -441,6 +411,7 @@ objcopy="${OBJCOPY-${cross_prefix}objcopy}"
ld="${LD-${cross_prefix}ld}" ld="${LD-${cross_prefix}ld}"
ranlib="${RANLIB-${cross_prefix}ranlib}" ranlib="${RANLIB-${cross_prefix}ranlib}"
nm="${NM-${cross_prefix}nm}" nm="${NM-${cross_prefix}nm}"
smbd="$SMBD"
strip="${STRIP-${cross_prefix}strip}" strip="${STRIP-${cross_prefix}strip}"
windres="${WINDRES-${cross_prefix}windres}" windres="${WINDRES-${cross_prefix}windres}"
pkg_config_exe="${PKG_CONFIG-${cross_prefix}pkg-config}" pkg_config_exe="${PKG_CONFIG-${cross_prefix}pkg-config}"
@ -560,7 +531,6 @@ darwin)
sunos) sunos)
solaris="yes" solaris="yes"
make="${MAKE-gmake}" make="${MAKE-gmake}"
smbd="${SMBD-/usr/sfw/sbin/smbd}"
# needed for CMSG_ macros in sys/socket.h # needed for CMSG_ macros in sys/socket.h
QEMU_CFLAGS="-D_XOPEN_SOURCE=600 $QEMU_CFLAGS" QEMU_CFLAGS="-D_XOPEN_SOURCE=600 $QEMU_CFLAGS"
# needed for TIOCWIN* defines in termios.h # needed for TIOCWIN* defines in termios.h
@ -714,7 +684,6 @@ if test "$mingw32" = "yes" ; then
write_c_skeleton; write_c_skeleton;
prefix="/qemu" prefix="/qemu"
qemu_suffix="" qemu_suffix=""
libs_qga="-lws2_32 -lwinmm -lpowrprof -lwtsapi32 -lwininet -liphlpapi -lnetapi32 $libs_qga"
fi fi
werror="" werror=""
@ -824,8 +793,6 @@ for opt do
;; ;;
--without-default-features) # processed above --without-default-features) # processed above
;; ;;
--enable-gprof) gprof="yes"
;;
--enable-gcov) gcov="yes" --enable-gcov) gcov="yes"
;; ;;
--static) --static)
@ -866,20 +833,12 @@ for opt do
# configure to be used by RPM and similar macros that set # configure to be used by RPM and similar macros that set
# lots of directory switches by default. # lots of directory switches by default.
;; ;;
--disable-qom-cast-debug) qom_cast_debug="no"
;;
--enable-qom-cast-debug) qom_cast_debug="yes"
;;
--audio-drv-list=*) audio_drv_list="$optarg" --audio-drv-list=*) audio_drv_list="$optarg"
;; ;;
--block-drv-rw-whitelist=*|--block-drv-whitelist=*) block_drv_rw_whitelist=$(echo "$optarg" | sed -e 's/,/ /g') --block-drv-rw-whitelist=*|--block-drv-whitelist=*) block_drv_rw_whitelist=$(echo "$optarg" | sed -e 's/,/ /g')
;; ;;
--block-drv-ro-whitelist=*) block_drv_ro_whitelist=$(echo "$optarg" | sed -e 's/,/ /g') --block-drv-ro-whitelist=*) block_drv_ro_whitelist=$(echo "$optarg" | sed -e 's/,/ /g')
;; ;;
--enable-block-drv-whitelist-in-tools) block_drv_whitelist_tools="yes"
;;
--disable-block-drv-whitelist-in-tools) block_drv_whitelist_tools="no"
;;
--enable-debug-tcg) debug_tcg="yes" --enable-debug-tcg) debug_tcg="yes"
;; ;;
--disable-debug-tcg) debug_tcg="no" --disable-debug-tcg) debug_tcg="no"
@ -887,7 +846,7 @@ for opt do
--enable-debug) --enable-debug)
# Enable debugging options that aren't excessively noisy # Enable debugging options that aren't excessively noisy
debug_tcg="yes" debug_tcg="yes"
debug_mutex="yes" meson_option_parse --enable-debug-mutex ""
debug="yes" debug="yes"
fortify_source="no" fortify_source="no"
;; ;;
@ -916,8 +875,6 @@ for opt do
;; ;;
--enable-tcg) tcg="enabled" --enable-tcg) tcg="enabled"
;; ;;
--enable-profiler) profiler="yes"
;;
--disable-system) softmmu="no" --disable-system) softmmu="no"
;; ;;
--enable-system) softmmu="yes" --enable-system) softmmu="yes"
@ -969,24 +926,10 @@ for opt do
;; ;;
--enable-fdt=*) fdt="$optarg" --enable-fdt=*) fdt="$optarg"
;; ;;
--disable-membarrier) membarrier="no"
;;
--enable-membarrier) membarrier="yes"
;;
--with-pkgversion=*) pkgversion="$optarg" --with-pkgversion=*) pkgversion="$optarg"
;; ;;
--with-coroutine=*) coroutine="$optarg" --with-coroutine=*) coroutine="$optarg"
;; ;;
--disable-coroutine-pool) coroutine_pool="no"
;;
--enable-coroutine-pool) coroutine_pool="yes"
;;
--enable-debug-stack-usage) debug_stack_usage="yes"
;;
--enable-crypto-afalg) crypto_afalg="yes"
;;
--disable-crypto-afalg) crypto_afalg="no"
;;
--disable-vhost-net) vhost_net="no" --disable-vhost-net) vhost_net="no"
;; ;;
--enable-vhost-net) vhost_net="yes" --enable-vhost-net) vhost_net="yes"
@ -1013,34 +956,6 @@ for opt do
;; ;;
--disable-zlib-test) --disable-zlib-test)
;; ;;
--enable-guest-agent) guest_agent="yes"
;;
--disable-guest-agent) guest_agent="no"
;;
--with-vss-sdk) vss_win32_sdk=""
;;
--with-vss-sdk=*) vss_win32_sdk="$optarg"
;;
--without-vss-sdk) vss_win32_sdk="no"
;;
--with-win-sdk) win_sdk=""
;;
--with-win-sdk=*) win_sdk="$optarg"
;;
--without-win-sdk) win_sdk="no"
;;
--enable-tools) want_tools="yes"
;;
--disable-tools) want_tools="no"
;;
--disable-avx2) avx2_opt="no"
;;
--enable-avx2) avx2_opt="yes"
;;
--disable-avx512f) avx512f_opt="no"
;;
--enable-avx512f) avx512f_opt="yes"
;;
--disable-virtio-blk-data-plane|--enable-virtio-blk-data-plane) --disable-virtio-blk-data-plane|--enable-virtio-blk-data-plane)
echo "$0: $opt is obsolete, virtio-blk data-plane is always on" >&2 echo "$0: $opt is obsolete, virtio-blk data-plane is always on" >&2
;; ;;
@ -1060,54 +975,6 @@ for opt do
;; ;;
--disable-pvrdma) pvrdma="no" --disable-pvrdma) pvrdma="no"
;; ;;
--disable-tpm) tpm="no"
;;
--enable-tpm) tpm="yes"
;;
--disable-live-block-migration) live_block_migration="no"
;;
--enable-live-block-migration) live_block_migration="yes"
;;
--disable-numa) numa="no"
;;
--enable-numa) numa="yes"
;;
--disable-replication) replication="no"
;;
--enable-replication) replication="yes"
;;
--disable-bochs) bochs="no"
;;
--enable-bochs) bochs="yes"
;;
--disable-cloop) cloop="no"
;;
--enable-cloop) cloop="yes"
;;
--disable-dmg) dmg="no"
;;
--enable-dmg) dmg="yes"
;;
--disable-qcow1) qcow1="no"
;;
--enable-qcow1) qcow1="yes"
;;
--disable-vdi) vdi="no"
;;
--enable-vdi) vdi="yes"
;;
--disable-vvfat) vvfat="no"
;;
--enable-vvfat) vvfat="yes"
;;
--disable-qed) qed="no"
;;
--enable-qed) qed="yes"
;;
--disable-parallels) parallels="no"
;;
--enable-parallels) parallels="yes"
;;
--disable-vhost-user) vhost_user="no" --disable-vhost-user) vhost_user="no"
;; ;;
--enable-vhost-user) vhost_user="yes" --enable-vhost-user) vhost_user="yes"
@ -1133,10 +1000,6 @@ for opt do
--with-git-submodules=*) --with-git-submodules=*)
git_submodules_action="$optarg" git_submodules_action="$optarg"
;; ;;
--enable-debug-mutex) debug_mutex=yes
;;
--disable-debug-mutex) debug_mutex=no
;;
--enable-plugins) if test "$mingw32" = "yes"; then --enable-plugins) if test "$mingw32" = "yes"; then
error_exit "TCG plugins not currently supported on Windows platforms" error_exit "TCG plugins not currently supported on Windows platforms"
else else
@ -1151,10 +1014,6 @@ for opt do
;; ;;
--gdb=*) gdb_bin="$optarg" --gdb=*) gdb_bin="$optarg"
;; ;;
--enable-rng-none) rng_none=yes
;;
--disable-rng-none) rng_none=no
;;
--enable-keyring) secret_keyring="yes" --enable-keyring) secret_keyring="yes"
;; ;;
--disable-keyring) secret_keyring="no" --disable-keyring) secret_keyring="no"
@ -1163,10 +1022,6 @@ for opt do
;; ;;
--disable-gio) gio=no --disable-gio) gio=no
;; ;;
--enable-slirp-smbd) slirp_smbd=yes
;;
--disable-slirp-smbd) slirp_smbd=no
;;
# backwards compatibility options # backwards compatibility options
--enable-trace-backend=*) meson_option_parse "--enable-trace-backends=$optarg" "$optarg" --enable-trace-backend=*) meson_option_parse "--enable-trace-backends=$optarg" "$optarg"
;; ;;
@ -1357,21 +1212,13 @@ Advanced options (experts only):
--block-drv-ro-whitelist=L --block-drv-ro-whitelist=L
set block driver read-only whitelist set block driver read-only whitelist
(by default affects only QEMU, not tools like qemu-img) (by default affects only QEMU, not tools like qemu-img)
--enable-block-drv-whitelist-in-tools
use block whitelist also in tools instead of only QEMU
--with-trace-file=NAME Full PATH,NAME of file to store traces --with-trace-file=NAME Full PATH,NAME of file to store traces
Default:trace-<pid> Default:trace-<pid>
--cpu=CPU Build for host CPU [$cpu] --cpu=CPU Build for host CPU [$cpu]
--with-coroutine=BACKEND coroutine backend. Supported options: --with-coroutine=BACKEND coroutine backend. Supported options:
ucontext, sigaltstack, windows ucontext, sigaltstack, windows
--enable-gcov enable test coverage analysis with gcov --enable-gcov enable test coverage analysis with gcov
--with-vss-sdk=SDK-path enable Windows VSS support in QEMU Guest Agent
--with-win-sdk=SDK-path path to Windows Platform SDK (to build VSS .tlb)
--tls-priority default TLS protocol/cipher priority string --tls-priority default TLS protocol/cipher priority string
--enable-gprof QEMU profiling with gprof
--enable-profiler profiler support
--enable-debug-stack-usage
track the maximum stack usage of stacks created by qemu_alloc_stack
--enable-plugins --enable-plugins
enable plugins via shared library loading enable plugins via shared library loading
--disable-containers don't use containers for cross-building --disable-containers don't use containers for cross-building
@ -1383,7 +1230,6 @@ cat << EOF
user supported user emulation targets user supported user emulation targets
linux-user all linux usermode emulation targets linux-user all linux usermode emulation targets
bsd-user all BSD usermode emulation targets bsd-user all BSD usermode emulation targets
guest-agent build the QEMU Guest Agent
pie Position Independent Executables pie Position Independent Executables
modules modules support (non-Windows) modules modules support (non-Windows)
module-upgrades try to load modules from alternate paths for upgrades module-upgrades try to load modules from alternate paths for upgrades
@ -1392,7 +1238,6 @@ cat << EOF
lto Enable Link-Time Optimization. lto Enable Link-Time Optimization.
safe-stack SafeStack Stack Smash Protection. Depends on safe-stack SafeStack Stack Smash Protection. Depends on
clang/llvm >= 3.7 and requires coroutine backend ucontext. clang/llvm >= 3.7 and requires coroutine backend ucontext.
membarrier membarrier system call (for Linux 4.14+ or Windows)
rdma Enable RDMA-based migration rdma Enable RDMA-based migration
pvrdma Enable PVRDMA support pvrdma Enable PVRDMA support
vhost-net vhost-net kernel acceleration support vhost-net vhost-net kernel acceleration support
@ -1402,29 +1247,8 @@ cat << EOF
vhost-kernel vhost kernel backend support vhost-kernel vhost kernel backend support
vhost-user vhost-user backend support vhost-user vhost-user backend support
vhost-vdpa vhost-vdpa kernel backend support vhost-vdpa vhost-vdpa kernel backend support
live-block-migration Block migration in the main migration stream
coroutine-pool coroutine freelist (better performance)
tpm TPM support
numa libnuma support
avx2 AVX2 optimization support
avx512f AVX512F optimization support
replication replication support
opengl opengl support opengl opengl support
qom-cast-debug cast debugging support
tools build qemu-io, qemu-nbd and qemu-img tools
bochs bochs image format support
cloop cloop image format support
dmg dmg image format support
qcow1 qcow v1 image format support
vdi vdi image format support
vvfat vvfat image format support
qed qed image format support
parallels parallels image format support
crypto-afalg Linux AF_ALG crypto backend driver
debug-mutex mutex debugging support
rng-none dummy RNG, avoid using /dev/(u)random and getrandom()
gio libgio support gio libgio support
slirp-smbd use smbd (at path --smbd=*) in slirp networking
NOTE: The object files are built at the place where configure is launched NOTE: The object files are built at the place where configure is launched
EOF EOF
@ -1826,16 +1650,6 @@ else
exit 1 exit 1
fi fi
##########################################
# system tools
if test -z "$want_tools"; then
if test "$softmmu" = "no"; then
want_tools=no
else
want_tools=yes
fi
fi
######################################### #########################################
# vhost interdependencies and host support # vhost interdependencies and host support
@ -2425,21 +2239,6 @@ if test "$modules" = yes; then
fi fi
fi fi
##########################################
# TPM emulation is only on POSIX
if test "$tpm" = ""; then
if test "$mingw32" = "yes"; then
tpm=no
else
tpm=yes
fi
elif test "$tpm" = "yes"; then
if test "$mingw32" = "yes" ; then
error_exit "TPM emulation only available on POSIX systems"
fi
fi
########################################## ##########################################
# fdt probe # fdt probe
@ -2479,26 +2278,6 @@ EOF
fi fi
fi fi
##########################################
# libnuma probe
if test "$numa" != "no" ; then
cat > $TMPC << EOF
#include <numa.h>
int main(void) { return numa_available(); }
EOF
if compile_prog "" "-lnuma" ; then
numa=yes
numa_libs="-lnuma"
else
if test "$numa" = "yes" ; then
feature_not_found "numa" "install numactl devel"
fi
numa=no
fi
fi
# check for usbfs # check for usbfs
have_usbfs=no have_usbfs=no
if test "$linux_user" = "yes"; then if test "$linux_user" = "yes"; then
@ -2523,85 +2302,6 @@ EOF
fi fi
fi fi
##########################################
# check if we have VSS SDK headers for win
guest_agent_with_vss="no"
if test "$mingw32" = "yes" && test "$guest_agent" != "no" && \
test "$vss_win32_sdk" != "no" ; then
case "$vss_win32_sdk" in
"") vss_win32_include="-isystem $source_path" ;;
*\ *) # The SDK is installed in "Program Files" by default, but we cannot
# handle path with spaces. So we symlink the headers into ".sdk/vss".
vss_win32_include="-isystem $source_path/.sdk/vss"
symlink "$vss_win32_sdk/inc" "$source_path/.sdk/vss/inc"
;;
*) vss_win32_include="-isystem $vss_win32_sdk"
esac
cat > $TMPC << EOF
#define __MIDL_user_allocate_free_DEFINED__
#include <inc/win2003/vss.h>
int main(void) { return VSS_CTX_BACKUP; }
EOF
if compile_prog "$vss_win32_include" "" ; then
guest_agent_with_vss="yes"
QEMU_CFLAGS="$QEMU_CFLAGS $vss_win32_include"
libs_qga="-lole32 -loleaut32 -lshlwapi -lstdc++ -Wl,--enable-stdcall-fixup $libs_qga"
qga_vss_provider="qga/vss-win32/qga-vss.dll qga/vss-win32/qga-vss.tlb"
else
if test "$vss_win32_sdk" != "" ; then
echo "ERROR: Please download and install Microsoft VSS SDK:"
echo "ERROR: http://www.microsoft.com/en-us/download/details.aspx?id=23490"
echo "ERROR: On POSIX-systems, you can extract the SDK headers by:"
echo "ERROR: scripts/extract-vsssdk-headers setup.exe"
echo "ERROR: The headers are extracted in the directory \`inc'."
feature_not_found "VSS support"
fi
fi
fi
##########################################
# lookup Windows platform SDK (if not specified)
# The SDK is needed only to build .tlb (type library) file of guest agent
# VSS provider from the source. It is usually unnecessary because the
# pre-compiled .tlb file is included.
if test "$mingw32" = "yes" && test "$guest_agent" != "no" && \
test "$guest_agent_with_vss" = "yes" ; then
if test -z "$win_sdk"; then
programfiles="$PROGRAMFILES"
test -n "$PROGRAMW6432" && programfiles="$PROGRAMW6432"
if test -n "$programfiles"; then
win_sdk=$(ls -d "$programfiles/Microsoft SDKs/Windows/v"* | tail -1) 2>/dev/null
else
feature_not_found "Windows SDK"
fi
elif test "$win_sdk" = "no"; then
win_sdk=""
fi
fi
##########################################
# check if mingw environment provides a recent ntddscsi.h
guest_agent_ntddscsi="no"
if test "$mingw32" = "yes" && test "$guest_agent" != "no"; then
cat > $TMPC << EOF
#include <windows.h>
#include <ntddscsi.h>
int main(void) {
#if !defined(IOCTL_SCSI_GET_ADDRESS)
#error Missing required ioctl definitions
#endif
SCSI_ADDRESS addr = { .Lun = 0, .TargetId = 0, .PathId = 0 };
return addr.Lun;
}
EOF
if compile_prog "" "" ; then
guest_agent_ntddscsi=yes
libs_qga="-lsetupapi -lcfgmgr32 $libs_qga"
fi
fi
########################################## ##########################################
# capstone # capstone
@ -2667,17 +2367,6 @@ else
esac esac
fi fi
if test "$coroutine_pool" = ""; then
coroutine_pool=yes
fi
if test "$debug_stack_usage" = "yes"; then
if test "$coroutine_pool" = "yes"; then
echo "WARN: disabling coroutine pool for stack usage debugging"
coroutine_pool=no
fi
fi
################################################## ##################################################
# SafeStack # SafeStack
@ -2740,85 +2429,6 @@ else # "$safe_stack" = ""
fi fi
fi fi
########################################
# check if cpuid.h is usable.
cat > $TMPC << EOF
#include <cpuid.h>
int main(void) {
unsigned a, b, c, d;
unsigned max = __get_cpuid_max(0, 0);
if (max >= 1) {
__cpuid(1, a, b, c, d);
}
if (max >= 7) {
__cpuid_count(7, 0, a, b, c, d);
}
return 0;
}
EOF
if compile_prog "" "" ; then
cpuid_h=yes
fi
##########################################
# avx2 optimization requirement check
#
# There is no point enabling this if cpuid.h is not usable,
# since we won't be able to select the new routines.
if test "$cpuid_h" = "yes" && test "$avx2_opt" != "no"; then
cat > $TMPC << EOF
#pragma GCC push_options
#pragma GCC target("avx2")
#include <cpuid.h>
#include <immintrin.h>
static int bar(void *a) {
__m256i x = *(__m256i *)a;
return _mm256_testz_si256(x, x);
}
int main(int argc, char *argv[]) { return bar(argv[0]); }
EOF
if compile_object "-Werror" ; then
avx2_opt="yes"
else
avx2_opt="no"
fi
fi
##########################################
# avx512f optimization requirement check
#
# There is no point enabling this if cpuid.h is not usable,
# since we won't be able to select the new routines.
# by default, it is turned off.
# if user explicitly want to enable it, check environment
if test "$cpuid_h" = "yes" && test "$avx512f_opt" = "yes"; then
cat > $TMPC << EOF
#pragma GCC push_options
#pragma GCC target("avx512f")
#include <cpuid.h>
#include <immintrin.h>
static int bar(void *a) {
__m512i x = *(__m512i *)a;
return _mm512_test_epi64_mask(x, x);
}
int main(int argc, char *argv[])
{
return bar(argv[0]);
}
EOF
if ! compile_object "-Werror" ; then
avx512f_opt="no"
fi
else
avx512f_opt="no"
fi
######################################## ########################################
# check if __[u]int128_t is usable. # check if __[u]int128_t is usable.
@ -2914,63 +2524,6 @@ if test "$fortify_source" != "no"; then
fi fi
fi fi
##########################################
# check for usable membarrier system call
if test "$membarrier" = "yes"; then
have_membarrier=no
if test "$mingw32" = "yes" ; then
have_membarrier=yes
elif test "$linux" = "yes" ; then
cat > $TMPC << EOF
#include <linux/membarrier.h>
#include <sys/syscall.h>
#include <unistd.h>
#include <stdlib.h>
int main(void) {
syscall(__NR_membarrier, MEMBARRIER_CMD_QUERY, 0);
syscall(__NR_membarrier, MEMBARRIER_CMD_SHARED, 0);
exit(0);
}
EOF
if compile_prog "" "" ; then
have_membarrier=yes
fi
fi
if test "$have_membarrier" = "no"; then
feature_not_found "membarrier" "membarrier system call not available"
fi
else
# Do not enable it by default even for Mingw32, because it doesn't
# work on Wine.
membarrier=no
fi
##########################################
# check for usable AF_ALG environment
have_afalg=no
cat > $TMPC << EOF
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <linux/if_alg.h>
int main(void) {
int sock;
sock = socket(AF_ALG, SOCK_SEQPACKET, 0);
return sock;
}
EOF
if compile_prog "" "" ; then
have_afalg=yes
fi
if test "$crypto_afalg" = "yes"
then
if test "$have_afalg" != "yes"
then
error_exit "AF_ALG requested but could not be detected"
fi
fi
########################################## ##########################################
# checks for sanitizers # checks for sanitizers
@ -3052,19 +2605,6 @@ case "$slirp" in
;; ;;
esac esac
# Check for slirp smbd dupport
: ${smbd=${SMBD-/usr/sbin/smbd}}
if test "$slirp_smbd" != "no" ; then
if test "$mingw32" = "yes" ; then
if test "$slirp_smbd" = "yes" ; then
error_exit "Host smbd not supported on this platform."
fi
slirp_smbd=no
else
slirp_smbd=yes
fi
fi
########################################## ##########################################
# check for usable __NR_keyctl syscall # check for usable __NR_keyctl syscall
@ -3120,11 +2660,6 @@ alpha)
;; ;;
esac esac
if test "$gprof" = "yes" ; then
QEMU_CFLAGS="-p $QEMU_CFLAGS"
QEMU_LDFLAGS="-p $QEMU_LDFLAGS"
fi
if test "$have_asan" = "yes"; then if test "$have_asan" = "yes"; then
QEMU_CFLAGS="-fsanitize=address $QEMU_CFLAGS" QEMU_CFLAGS="-fsanitize=address $QEMU_CFLAGS"
QEMU_LDFLAGS="-fsanitize=address $QEMU_LDFLAGS" QEMU_LDFLAGS="-fsanitize=address $QEMU_LDFLAGS"
@ -3176,20 +2711,6 @@ if test "$mingw32" = "yes" ; then
done done
fi fi
# Probe for guest agent support/options
if [ "$guest_agent" != "no" ]; then
if [ "$softmmu" = no -a "$want_tools" = no ] ; then
guest_agent=no
elif [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" -o "$mingw32" = "yes" ] ; then
guest_agent=yes
elif [ "$guest_agent" != yes ]; then
guest_agent=no
else
error_exit "Guest agent is not supported on this platform"
fi
fi
# Guest agent Windows MSI package # Guest agent Windows MSI package
if test "$QEMU_GA_MANUFACTURER" = ""; then if test "$QEMU_GA_MANUFACTURER" = ""; then
@ -3290,14 +2811,6 @@ if test "$debug_tcg" = "yes" ; then
fi fi
if test "$mingw32" = "yes" ; then if test "$mingw32" = "yes" ; then
echo "CONFIG_WIN32=y" >> $config_host_mak echo "CONFIG_WIN32=y" >> $config_host_mak
if test "$guest_agent_with_vss" = "yes" ; then
echo "CONFIG_QGA_VSS=y" >> $config_host_mak
echo "QGA_VSS_PROVIDER=$qga_vss_provider" >> $config_host_mak
echo "WIN_SDK=\"$win_sdk\"" >> $config_host_mak
fi
if test "$guest_agent_ntddscsi" = "yes" ; then
echo "CONFIG_QGA_NTDDSCSI=y" >> $config_host_mak
fi
echo "QEMU_GA_MSI_MINGW_DLL_PATH=${QEMU_GA_MSI_MINGW_DLL_PATH}" >> $config_host_mak echo "QEMU_GA_MSI_MINGW_DLL_PATH=${QEMU_GA_MSI_MINGW_DLL_PATH}" >> $config_host_mak
echo "QEMU_GA_MANUFACTURER=${QEMU_GA_MANUFACTURER}" >> $config_host_mak echo "QEMU_GA_MANUFACTURER=${QEMU_GA_MANUFACTURER}" >> $config_host_mak
echo "QEMU_GA_DISTRO=${QEMU_GA_DISTRO}" >> $config_host_mak echo "QEMU_GA_DISTRO=${QEMU_GA_DISTRO}" >> $config_host_mak
@ -3320,27 +2833,8 @@ fi
if test "$static" = "yes" ; then if test "$static" = "yes" ; then
echo "CONFIG_STATIC=y" >> $config_host_mak echo "CONFIG_STATIC=y" >> $config_host_mak
fi fi
if test "$profiler" = "yes" ; then
echo "CONFIG_PROFILER=y" >> $config_host_mak
fi
if test "$want_tools" = "yes" ; then
echo "CONFIG_TOOLS=y" >> $config_host_mak
fi
if test "$guest_agent" = "yes" ; then
echo "CONFIG_GUEST_AGENT=y" >> $config_host_mak
fi
if test "$slirp_smbd" = "yes" ; then
echo "CONFIG_SLIRP_SMBD=y" >> $config_host_mak
echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak
fi
if test "$gprof" = "yes" ; then
echo "CONFIG_GPROF=y" >> $config_host_mak
fi
echo "CONFIG_BDRV_RW_WHITELIST=$block_drv_rw_whitelist" >> $config_host_mak echo "CONFIG_BDRV_RW_WHITELIST=$block_drv_rw_whitelist" >> $config_host_mak
echo "CONFIG_BDRV_RO_WHITELIST=$block_drv_ro_whitelist" >> $config_host_mak echo "CONFIG_BDRV_RO_WHITELIST=$block_drv_ro_whitelist" >> $config_host_mak
if test "$block_drv_whitelist_tools" = "yes" ; then
echo "CONFIG_BDRV_WHITELIST_TOOLS=y" >> $config_host_mak
fi
qemu_version=$(head $source_path/VERSION) qemu_version=$(head $source_path/VERSION)
echo "PKGVERSION=$pkgversion" >>$config_host_mak echo "PKGVERSION=$pkgversion" >>$config_host_mak
echo "SRC_PATH=$source_path" >> $config_host_mak echo "SRC_PATH=$source_path" >> $config_host_mak
@ -3406,9 +2900,6 @@ fi
if test "$vhost_user_fs" = "yes" ; then if test "$vhost_user_fs" = "yes" ; then
echo "CONFIG_VHOST_USER_FS=y" >> $config_host_mak echo "CONFIG_VHOST_USER_FS=y" >> $config_host_mak
fi fi
if test "$membarrier" = "yes" ; then
echo "CONFIG_MEMBARRIER=y" >> $config_host_mak
fi
if test "$tcg" = "enabled" -a "$tcg_interpreter" = "true" ; then if test "$tcg" = "enabled" -a "$tcg_interpreter" = "true" ; then
echo "CONFIG_TCG_INTERPRETER=y" >> $config_host_mak echo "CONFIG_TCG_INTERPRETER=y" >> $config_host_mak
fi fi
@ -3419,37 +2910,12 @@ if test "$opengl" = "yes" ; then
echo "OPENGL_LIBS=$opengl_libs" >> $config_host_mak echo "OPENGL_LIBS=$opengl_libs" >> $config_host_mak
fi fi
if test "$avx2_opt" = "yes" ; then
echo "CONFIG_AVX2_OPT=y" >> $config_host_mak
fi
if test "$avx512f_opt" = "yes" ; then
echo "CONFIG_AVX512F_OPT=y" >> $config_host_mak
fi
# XXX: suppress that # XXX: suppress that
if [ "$bsd" = "yes" ] ; then if [ "$bsd" = "yes" ] ; then
echo "CONFIG_BSD=y" >> $config_host_mak echo "CONFIG_BSD=y" >> $config_host_mak
fi fi
if test "$qom_cast_debug" = "yes" ; then
echo "CONFIG_QOM_CAST_DEBUG=y" >> $config_host_mak
fi
echo "CONFIG_COROUTINE_BACKEND=$coroutine" >> $config_host_mak echo "CONFIG_COROUTINE_BACKEND=$coroutine" >> $config_host_mak
if test "$coroutine_pool" = "yes" ; then
echo "CONFIG_COROUTINE_POOL=1" >> $config_host_mak
else
echo "CONFIG_COROUTINE_POOL=0" >> $config_host_mak
fi
if test "$debug_stack_usage" = "yes" ; then
echo "CONFIG_DEBUG_STACK_USAGE=y" >> $config_host_mak
fi
if test "$crypto_afalg" = "yes" ; then
echo "CONFIG_AF_ALG=y" >> $config_host_mak
fi
if test "$have_asan_iface_fiber" = "yes" ; then if test "$have_asan_iface_fiber" = "yes" ; then
echo "CONFIG_ASAN_IFACE_FIBER=y" >> $config_host_mak echo "CONFIG_ASAN_IFACE_FIBER=y" >> $config_host_mak
@ -3459,10 +2925,6 @@ if test "$have_tsan" = "yes" && test "$have_tsan_iface_fiber" = "yes" ; then
echo "CONFIG_TSAN=y" >> $config_host_mak echo "CONFIG_TSAN=y" >> $config_host_mak
fi fi
if test "$cpuid_h" = "yes" ; then
echo "CONFIG_CPUID_H=y" >> $config_host_mak
fi
if test "$int128" = "yes" ; then if test "$int128" = "yes" ; then
echo "CONFIG_INT128=y" >> $config_host_mak echo "CONFIG_INT128=y" >> $config_host_mak
fi fi
@ -3475,14 +2937,6 @@ if test "$cmpxchg128" = "yes" ; then
echo "CONFIG_CMPXCHG128=y" >> $config_host_mak echo "CONFIG_CMPXCHG128=y" >> $config_host_mak
fi fi
if test "$live_block_migration" = "yes" ; then
echo "CONFIG_LIVE_BLOCK_MIGRATION=y" >> $config_host_mak
fi
if test "$tpm" = "yes"; then
echo 'CONFIG_TPM=y' >> $config_host_mak
fi
if test "$rdma" = "yes" ; then if test "$rdma" = "yes" ; then
echo "CONFIG_RDMA=y" >> $config_host_mak echo "CONFIG_RDMA=y" >> $config_host_mak
echo "RDMA_LIBS=$rdma_libs" >> $config_host_mak echo "RDMA_LIBS=$rdma_libs" >> $config_host_mak
@ -3492,39 +2946,6 @@ if test "$pvrdma" = "yes" ; then
echo "CONFIG_PVRDMA=y" >> $config_host_mak echo "CONFIG_PVRDMA=y" >> $config_host_mak
fi fi
if test "$replication" = "yes" ; then
echo "CONFIG_REPLICATION=y" >> $config_host_mak
fi
if test "$debug_mutex" = "yes" ; then
echo "CONFIG_DEBUG_MUTEX=y" >> $config_host_mak
fi
if test "$bochs" = "yes" ; then
echo "CONFIG_BOCHS=y" >> $config_host_mak
fi
if test "$cloop" = "yes" ; then
echo "CONFIG_CLOOP=y" >> $config_host_mak
fi
if test "$dmg" = "yes" ; then
echo "CONFIG_DMG=y" >> $config_host_mak
fi
if test "$qcow1" = "yes" ; then
echo "CONFIG_QCOW1=y" >> $config_host_mak
fi
if test "$vdi" = "yes" ; then
echo "CONFIG_VDI=y" >> $config_host_mak
fi
if test "$vvfat" = "yes" ; then
echo "CONFIG_VVFAT=y" >> $config_host_mak
fi
if test "$qed" = "yes" ; then
echo "CONFIG_QED=y" >> $config_host_mak
fi
if test "$parallels" = "yes" ; then
echo "CONFIG_PARALLELS=y" >> $config_host_mak
fi
if test "$plugins" = "yes" ; then if test "$plugins" = "yes" ; then
echo "CONFIG_PLUGIN=y" >> $config_host_mak echo "CONFIG_PLUGIN=y" >> $config_host_mak
fi fi
@ -3548,9 +2969,6 @@ echo "MESON=$meson" >> $config_host_mak
echo "NINJA=$ninja" >> $config_host_mak echo "NINJA=$ninja" >> $config_host_mak
echo "CC=$cc" >> $config_host_mak echo "CC=$cc" >> $config_host_mak
echo "HOST_CC=$host_cc" >> $config_host_mak echo "HOST_CC=$host_cc" >> $config_host_mak
if $iasl -h > /dev/null 2>&1; then
echo "CONFIG_IASL=$iasl" >> $config_host_mak
fi
echo "AR=$ar" >> $config_host_mak echo "AR=$ar" >> $config_host_mak
echo "AS=$as" >> $config_host_mak echo "AS=$as" >> $config_host_mak
echo "CCAS=$ccas" >> $config_host_mak echo "CCAS=$ccas" >> $config_host_mak
@ -3567,11 +2985,6 @@ echo "QEMU_LDFLAGS=$QEMU_LDFLAGS" >> $config_host_mak
echo "LD_I386_EMULATION=$ld_i386_emulation" >> $config_host_mak echo "LD_I386_EMULATION=$ld_i386_emulation" >> $config_host_mak
echo "STRIP=$strip" >> $config_host_mak echo "STRIP=$strip" >> $config_host_mak
echo "EXESUF=$EXESUF" >> $config_host_mak echo "EXESUF=$EXESUF" >> $config_host_mak
echo "LIBS_QGA=$libs_qga" >> $config_host_mak
if test "$rng_none" = "yes"; then
echo "CONFIG_RNG_NONE=y" >> $config_host_mak
fi
# use included Linux headers # use included Linux headers
if test "$linux" = "yes" ; then if test "$linux" = "yes" ; then
@ -3621,11 +3034,6 @@ if test "$default_targets" = "yes"; then
echo "CONFIG_DEFAULT_TARGETS=y" >> $config_host_mak echo "CONFIG_DEFAULT_TARGETS=y" >> $config_host_mak
fi fi
if test "$numa" = "yes"; then
echo "CONFIG_NUMA=y" >> $config_host_mak
echo "NUMA_LIBS=$numa_libs" >> $config_host_mak
fi
if test "$ccache_cpp2" = "yes"; then if test "$ccache_cpp2" = "yes"; then
echo "export CCACHE_CPP2=y" >> $config_host_mak echo "export CCACHE_CPP2=y" >> $config_host_mak
fi fi
@ -3778,8 +3186,10 @@ if test "$skip_meson" = no; then
-Daudio_drv_list=$audio_drv_list \ -Daudio_drv_list=$audio_drv_list \
-Ddefault_devices=$default_devices \ -Ddefault_devices=$default_devices \
-Ddocdir="$docdir" \ -Ddocdir="$docdir" \
-Diasl="$($iasl -h >/dev/null 2>&1 && printf %s "$iasl")" \
-Dqemu_firmwarepath="$firmwarepath" \ -Dqemu_firmwarepath="$firmwarepath" \
-Dqemu_suffix="$qemu_suffix" \ -Dqemu_suffix="$qemu_suffix" \
-Dsmbd="$smbd" \
-Dsphinx_build="$sphinx_build" \ -Dsphinx_build="$sphinx_build" \
-Dtrace_file="$trace_file" \ -Dtrace_file="$trace_file" \
-Doptimization=$(if test "$debug" = yes; then echo 0; else echo 2; fi) \ -Doptimization=$(if test "$debug" = yes; then echo 0; else echo 2; fi) \

View File

@ -1,5 +1,4 @@
if 'CONFIG_TOOLS' in config_host and virgl.found() and gbm.found() \ if have_vhost_user_gpu
and 'CONFIG_LINUX' in config_host and pixman.found()
executable('vhost-user-gpu', files('vhost-user-gpu.c', 'virgl.c', 'vugbm.c'), executable('vhost-user-gpu', files('vhost-user-gpu.c', 'virgl.c', 'vugbm.c'),
dependencies: [qemuutil, pixman, gbm, virgl, vhost_user, opengl], dependencies: [qemuutil, pixman, gbm, virgl, vhost_user, opengl],
install: true, install: true,

View File

@ -35,7 +35,9 @@ else
endif endif
crypto_ss.add(when: 'CONFIG_SECRET_KEYRING', if_true: files('secret_keyring.c')) crypto_ss.add(when: 'CONFIG_SECRET_KEYRING', if_true: files('secret_keyring.c'))
crypto_ss.add(when: 'CONFIG_AF_ALG', if_true: files('afalg.c', 'cipher-afalg.c', 'hash-afalg.c')) if have_afalg
crypto_ss.add(if_true: files('afalg.c', 'cipher-afalg.c', 'hash-afalg.c'))
endif
crypto_ss.add(when: gnutls, if_true: files('tls-cipher-suites.c')) crypto_ss.add(when: gnutls, if_true: files('tls-cipher-suites.c'))
util_ss.add(files('aes.c')) util_ss.add(files('aes.c'))
@ -48,7 +50,7 @@ if gcrypt.found()
util_ss.add(gcrypt, files('random-gcrypt.c')) util_ss.add(gcrypt, files('random-gcrypt.c'))
elif gnutls.found() elif gnutls.found()
util_ss.add(gnutls, files('random-gnutls.c')) util_ss.add(gnutls, files('random-gnutls.c'))
elif 'CONFIG_RNG_NONE' in config_host elif get_option('rng_none')
util_ss.add(files('random-none.c')) util_ss.add(files('random-none.c'))
else else
util_ss.add(files('random-platform.c')) util_ss.add(files('random-platform.c'))

View File

@ -305,7 +305,7 @@ and also listed as follows in the top-level meson.build's host_kconfig
variable:: variable::
host_kconfig = \ host_kconfig = \
('CONFIG_TPM' in config_host ? ['CONFIG_TPM=y'] : []) + \ (have_tpm ? ['CONFIG_TPM=y'] : []) + \
('CONFIG_SPICE' in config_host ? ['CONFIG_SPICE=y'] : []) + \ ('CONFIG_SPICE' in config_host ? ['CONFIG_SPICE=y'] : []) + \
(have_ivshmem ? ['CONFIG_IVSHMEM=y'] : []) + \ (have_ivshmem ? ['CONFIG_IVSHMEM=y'] : []) + \
... ...

View File

@ -37,8 +37,6 @@ endif
if build_docs if build_docs
SPHINX_ARGS += ['-Dversion=' + meson.project_version(), '-Drelease=' + config_host['PKGVERSION']] SPHINX_ARGS += ['-Dversion=' + meson.project_version(), '-Drelease=' + config_host['PKGVERSION']]
have_ga = have_tools and config_host.has_key('CONFIG_GUEST_AGENT')
man_pages = { man_pages = {
'qemu-ga.8': (have_ga ? 'man8' : ''), 'qemu-ga.8': (have_ga ? 'man8' : ''),
'qemu-ga-ref.7': (have_ga ? 'man7' : ''), 'qemu-ga-ref.7': (have_ga ? 'man7' : ''),

View File

@ -25,7 +25,9 @@ acpi_ss.add(when: 'CONFIG_ACPI_X86_ICH', if_true: files('ich9.c', 'tco.c'))
acpi_ss.add(when: 'CONFIG_ACPI_ERST', if_true: files('erst.c')) acpi_ss.add(when: 'CONFIG_ACPI_ERST', if_true: files('erst.c'))
acpi_ss.add(when: 'CONFIG_IPMI', if_true: files('ipmi.c'), if_false: files('ipmi-stub.c')) acpi_ss.add(when: 'CONFIG_IPMI', if_true: files('ipmi.c'), if_false: files('ipmi-stub.c'))
acpi_ss.add(when: 'CONFIG_PC', if_false: files('acpi-x86-stub.c')) acpi_ss.add(when: 'CONFIG_PC', if_false: files('acpi-x86-stub.c'))
acpi_ss.add(when: 'CONFIG_TPM', if_true: files('tpm.c')) if have_tpm
acpi_ss.add(files('tpm.c'))
endif
softmmu_ss.add(when: 'CONFIG_ACPI', if_false: files('acpi-stub.c', 'aml-build-stub.c', 'ghes-stub.c')) softmmu_ss.add(when: 'CONFIG_ACPI', if_false: files('acpi-stub.c', 'aml-build-stub.c', 'ghes-stub.c'))
softmmu_ss.add_all(when: 'CONFIG_ACPI', if_true: acpi_ss) softmmu_ss.add_all(when: 'CONFIG_ACPI', if_true: acpi_ss)
softmmu_ss.add(when: 'CONFIG_ALL', if_true: files('acpi-stub.c', 'aml-build-stub.c', softmmu_ss.add(when: 'CONFIG_ALL', if_true: files('acpi-stub.c', 'aml-build-stub.c',

View File

@ -1,4 +1,4 @@
project('qemu', ['c'], meson_version: '>=0.58.2', project('qemu', ['c'], meson_version: '>=0.59.3',
default_options: ['warning_level=1', 'c_std=gnu11', 'cpp_std=gnu++11', 'b_colorout=auto', default_options: ['warning_level=1', 'c_std=gnu11', 'cpp_std=gnu++11', 'b_colorout=auto',
'b_staticpic=false', 'stdsplit=false'], 'b_staticpic=false', 'stdsplit=false'],
version: files('VERSION')) version: files('VERSION'))
@ -44,21 +44,7 @@ config_host_data = configuration_data()
genh = [] genh = []
qapi_trace_events = [] qapi_trace_events = []
target_dirs = config_host['TARGET_DIRS'].split() bsd_oses = ['gnu/kfreebsd', 'freebsd', 'netbsd', 'openbsd', 'dragonfly', 'darwin']
have_linux_user = false
have_bsd_user = false
have_system = false
foreach target : target_dirs
have_linux_user = have_linux_user or target.endswith('linux-user')
have_bsd_user = have_bsd_user or target.endswith('bsd-user')
have_system = have_system or target.endswith('-softmmu')
endforeach
have_user = have_linux_user or have_bsd_user
have_tools = 'CONFIG_TOOLS' in config_host
have_block = have_system or have_tools
python = import('python').find_installation()
supported_oses = ['windows', 'freebsd', 'netbsd', 'openbsd', 'darwin', 'sunos', 'linux'] supported_oses = ['windows', 'freebsd', 'netbsd', 'openbsd', 'darwin', 'sunos', 'linux']
supported_cpus = ['ppc', 'ppc64', 's390x', 'riscv', 'x86', 'x86_64', supported_cpus = ['ppc', 'ppc64', 's390x', 'riscv', 'x86', 'x86_64',
'arm', 'aarch64', 'loongarch64', 'mips', 'mips64', 'sparc', 'sparc64'] 'arm', 'aarch64', 'loongarch64', 'mips', 'mips64', 'sparc', 'sparc64']
@ -72,6 +58,28 @@ endif
targetos = host_machine.system() targetos = host_machine.system()
target_dirs = config_host['TARGET_DIRS'].split()
have_linux_user = false
have_bsd_user = false
have_system = false
foreach target : target_dirs
have_linux_user = have_linux_user or target.endswith('linux-user')
have_bsd_user = have_bsd_user or target.endswith('bsd-user')
have_system = have_system or target.endswith('-softmmu')
endforeach
have_user = have_linux_user or have_bsd_user
have_tools = get_option('tools') \
.disable_auto_if(not have_system) \
.allowed()
have_ga = get_option('guest_agent') \
.disable_auto_if(not have_system and not have_tools) \
.require(targetos in ['sunos', 'linux', 'windows'],
error_message: 'unsupported OS for QEMU guest agent') \
.allowed()
have_block = have_system or have_tools
python = import('python').find_installation()
if cpu not in supported_cpus if cpu not in supported_cpus
host_arch = 'unknown' host_arch = 'unknown'
elif cpu == 'x86' elif cpu == 'x86'
@ -99,7 +107,7 @@ else
endif endif
kvm_targets_c = '""' kvm_targets_c = '""'
if not get_option('kvm').disabled() and targetos == 'linux' if get_option('kvm').allowed() and targetos == 'linux'
kvm_targets_c = '"' + '" ,"'.join(kvm_targets) + '"' kvm_targets_c = '"' + '" ,"'.join(kvm_targets) + '"'
endif endif
config_host_data.set('CONFIG_KVM_TARGETS', kvm_targets_c) config_host_data.set('CONFIG_KVM_TARGETS', kvm_targets_c)
@ -163,6 +171,16 @@ endif
# Compiler flags # # Compiler flags #
################## ##################
qemu_cflags = config_host['QEMU_CFLAGS'].split()
qemu_cxxflags = config_host['QEMU_CXXFLAGS'].split()
qemu_ldflags = config_host['QEMU_LDFLAGS'].split()
if get_option('gprof')
qemu_cflags += ['-p']
qemu_cxxflags += ['-p']
qemu_ldflags += ['-p']
endif
# Specify linker-script with add_project_link_arguments so that it is not placed # Specify linker-script with add_project_link_arguments so that it is not placed
# within a linker --start-group/--end-group pair # within a linker --start-group/--end-group pair
if get_option('fuzzing') if get_option('fuzzing')
@ -198,12 +216,9 @@ if get_option('fuzzing')
endif endif
endif endif
add_global_arguments(config_host['QEMU_CFLAGS'].split(), add_global_arguments(qemu_cflags, native: false, language: ['c', 'objc'])
native: false, language: ['c', 'objc']) add_global_arguments(qemu_cxxflags, native: false, language: ['cpp'])
add_global_arguments(config_host['QEMU_CXXFLAGS'].split(), add_global_link_arguments(qemu_ldflags, native: false, language: ['c', 'cpp', 'objc'])
native: false, language: 'cpp')
add_global_link_arguments(config_host['QEMU_LDFLAGS'].split(),
native: false, language: ['c', 'cpp', 'objc'])
if targetos == 'linux' if targetos == 'linux'
add_project_arguments('-isystem', meson.current_source_dir() / 'linux-headers', add_project_arguments('-isystem', meson.current_source_dir() / 'linux-headers',
@ -269,14 +284,16 @@ if 'syslog' in get_option('trace_backends') and not cc.compiles('''
endif endif
# Miscellaneous Linux-only features # Miscellaneous Linux-only features
if targetos != 'linux' and get_option('mpath').enabled() get_option('mpath') \
error('Multipath is supported only on Linux') .require(targetos == 'linux', error_message: 'Multipath is supported only on Linux')
endif
if targetos != 'linux' and get_option('multiprocess').enabled() multiprocess_allowed = get_option('multiprocess') \
error('Multiprocess QEMU is supported only on Linux') .require(targetos == 'linux', error_message: 'Multiprocess QEMU is supported only on Linux') \
endif .allowed()
multiprocess_allowed = targetos == 'linux' and not get_option('multiprocess').disabled()
have_tpm = get_option('tpm') \
.require(targetos != 'windows', error_message: 'TPM emulation only available on POSIX systems') \
.allowed()
# Target-specific libraries and flags # Target-specific libraries and flags
libm = cc.find_library('m', required: false) libm = cc.find_library('m', required: false)
@ -290,8 +307,12 @@ iokit = []
emulator_link_args = [] emulator_link_args = []
nvmm =not_found nvmm =not_found
hvf = not_found hvf = not_found
midl = not_found
widl = not_found
host_dsosuf = '.so' host_dsosuf = '.so'
if targetos == 'windows' if targetos == 'windows'
midl = find_program('midl', required: false)
widl = find_program('widl', required: false)
socket = cc.find_library('ws2_32') socket = cc.find_library('ws2_32')
winmm = cc.find_library('winmm') winmm = cc.find_library('winmm')
@ -313,7 +334,7 @@ elif targetos == 'haiku'
cc.find_library('network'), cc.find_library('network'),
cc.find_library('bsd')] cc.find_library('bsd')]
elif targetos == 'openbsd' elif targetos == 'openbsd'
if not get_option('tcg').disabled() and target_dirs.length() > 0 if get_option('tcg').allowed() and target_dirs.length() > 0
# Disable OpenBSD W^X if available # Disable OpenBSD W^X if available
emulator_link_args = cc.get_supported_link_arguments('-Wl,-z,wxneeded') emulator_link_args = cc.get_supported_link_arguments('-Wl,-z,wxneeded')
endif endif
@ -321,16 +342,16 @@ endif
# Target-specific configuration of accelerators # Target-specific configuration of accelerators
accelerators = [] accelerators = []
if not get_option('kvm').disabled() and targetos == 'linux' if get_option('kvm').allowed() and targetos == 'linux'
accelerators += 'CONFIG_KVM' accelerators += 'CONFIG_KVM'
endif endif
if not get_option('xen').disabled() and 'CONFIG_XEN_BACKEND' in config_host if get_option('xen').allowed() and 'CONFIG_XEN_BACKEND' in config_host
accelerators += 'CONFIG_XEN' accelerators += 'CONFIG_XEN'
have_xen_pci_passthrough = not get_option('xen_pci_passthrough').disabled() and targetos == 'linux' have_xen_pci_passthrough = get_option('xen_pci_passthrough').allowed() and targetos == 'linux'
else else
have_xen_pci_passthrough = false have_xen_pci_passthrough = false
endif endif
if not get_option('whpx').disabled() and targetos == 'windows' if get_option('whpx').allowed() and targetos == 'windows'
if get_option('whpx').enabled() and host_machine.cpu() != 'x86_64' if get_option('whpx').enabled() and host_machine.cpu() != 'x86_64'
error('WHPX requires 64-bit host') error('WHPX requires 64-bit host')
elif cc.has_header('WinHvPlatform.h', required: get_option('whpx')) and \ elif cc.has_header('WinHvPlatform.h', required: get_option('whpx')) and \
@ -338,14 +359,14 @@ if not get_option('whpx').disabled() and targetos == 'windows'
accelerators += 'CONFIG_WHPX' accelerators += 'CONFIG_WHPX'
endif endif
endif endif
if not get_option('hvf').disabled() if get_option('hvf').allowed()
hvf = dependency('appleframeworks', modules: 'Hypervisor', hvf = dependency('appleframeworks', modules: 'Hypervisor',
required: get_option('hvf')) required: get_option('hvf'))
if hvf.found() if hvf.found()
accelerators += 'CONFIG_HVF' accelerators += 'CONFIG_HVF'
endif endif
endif endif
if not get_option('hax').disabled() if get_option('hax').allowed()
if get_option('hax').enabled() or targetos in ['windows', 'darwin', 'netbsd'] if get_option('hax').enabled() or targetos in ['windows', 'darwin', 'netbsd']
accelerators += 'CONFIG_HAX' accelerators += 'CONFIG_HAX'
endif endif
@ -358,7 +379,7 @@ if targetos == 'netbsd'
endif endif
tcg_arch = host_arch tcg_arch = host_arch
if not get_option('tcg').disabled() if get_option('tcg').allowed()
if host_arch == 'unknown' if host_arch == 'unknown'
if get_option('tcg_interpreter') if get_option('tcg_interpreter')
warning('Unsupported CPU @0@, will use TCG with TCI (slow)'.format(cpu)) warning('Unsupported CPU @0@, will use TCG with TCI (slow)'.format(cpu))
@ -472,7 +493,7 @@ libattr_test = '''
libattr = not_found libattr = not_found
have_old_libattr = false have_old_libattr = false
if not get_option('attr').disabled() if get_option('attr').allowed()
if cc.links(libattr_test) if cc.links(libattr_test)
libattr = declare_dependency() libattr = declare_dependency()
else else
@ -604,7 +625,9 @@ if not get_option('zstd').auto() or have_block
method: 'pkg-config', kwargs: static_kwargs) method: 'pkg-config', kwargs: static_kwargs)
endif endif
virgl = not_found virgl = not_found
if not get_option('virglrenderer').auto() or have_system
have_vhost_user_gpu = have_tools and targetos == 'linux' and pixman.found()
if not get_option('virglrenderer').auto() or have_system or have_vhost_user_gpu
virgl = dependency('virglrenderer', virgl = dependency('virglrenderer',
method: 'pkg-config', method: 'pkg-config',
required: get_option('virglrenderer'), required: get_option('virglrenderer'),
@ -628,7 +651,7 @@ endif
mpathlibs = [libudev] mpathlibs = [libudev]
mpathpersist = not_found mpathpersist = not_found
mpathpersist_new_api = false mpathpersist_new_api = false
if targetos == 'linux' and have_tools and not get_option('mpath').disabled() if targetos == 'linux' and have_tools and get_option('mpath').allowed()
mpath_test_source_new = ''' mpath_test_source_new = '''
#include <libudev.h> #include <libudev.h>
#include <mpath_persist.h> #include <mpath_persist.h>
@ -697,7 +720,7 @@ endif
iconv = not_found iconv = not_found
curses = not_found curses = not_found
if have_system and not get_option('curses').disabled() if have_system and get_option('curses').allowed()
curses_test = ''' curses_test = '''
#if defined(__APPLE__) || defined(__OpenBSD__) #if defined(__APPLE__) || defined(__OpenBSD__)
#define _XOPEN_SOURCE_EXTENDED 1 #define _XOPEN_SOURCE_EXTENDED 1
@ -759,7 +782,7 @@ if have_system and not get_option('curses').disabled()
endforeach endforeach
endif endif
endif endif
if not get_option('iconv').disabled() if get_option('iconv').allowed()
foreach link_args : [ ['-liconv'], [] ] foreach link_args : [ ['-liconv'], [] ]
# Programs will be linked with glib and this will bring in libiconv on FreeBSD. # Programs will be linked with glib and this will bring in libiconv on FreeBSD.
# We need to use libiconv if available because mixing libiconv's headers with # We need to use libiconv if available because mixing libiconv's headers with
@ -938,7 +961,7 @@ if liblzfse.found() and not cc.links('''
endif endif
oss = not_found oss = not_found
if have_system and not get_option('oss').disabled() if get_option('oss').allowed() and have_system
if not cc.has_header('sys/soundcard.h') if not cc.has_header('sys/soundcard.h')
# not found # not found
elif targetos == 'netbsd' elif targetos == 'netbsd'
@ -983,6 +1006,7 @@ if (have_system or have_tools) and (virgl.found() or opengl.found())
gbm = dependency('gbm', method: 'pkg-config', required: false, gbm = dependency('gbm', method: 'pkg-config', required: false,
kwargs: static_kwargs) kwargs: static_kwargs)
endif endif
have_vhost_user_gpu = have_vhost_user_gpu and virgl.found() and gbm.found()
gnutls = not_found gnutls = not_found
gnutls_crypto = not_found gnutls_crypto = not_found
@ -1092,7 +1116,7 @@ vnc = not_found
png = not_found png = not_found
jpeg = not_found jpeg = not_found
sasl = not_found sasl = not_found
if have_system and not get_option('vnc').disabled() if get_option('vnc').allowed() and have_system
vnc = declare_dependency() # dummy dependency vnc = declare_dependency() # dummy dependency
png = dependency('libpng', required: get_option('vnc_png'), png = dependency('libpng', required: get_option('vnc_png'),
method: 'pkg-config', kwargs: static_kwargs) method: 'pkg-config', kwargs: static_kwargs)
@ -1166,14 +1190,28 @@ if lzo.found() and not cc.links('''
endif endif
endif endif
numa = not_found
if not get_option('numa').auto() or have_system or have_tools
numa = cc.find_library('numa', has_headers: ['numa.h'],
required: get_option('numa'),
kwargs: static_kwargs)
endif
if numa.found() and not cc.links('''
#include <numa.h>
int main(void) { return numa_available(); }
''', dependencies: numa)
numa = not_found
if get_option('numa').enabled()
error('could not link numa')
else
warning('could not link numa, disabling')
endif
endif
rdma = not_found rdma = not_found
if 'CONFIG_RDMA' in config_host if 'CONFIG_RDMA' in config_host
rdma = declare_dependency(link_args: config_host['RDMA_LIBS'].split()) rdma = declare_dependency(link_args: config_host['RDMA_LIBS'].split())
endif endif
numa = not_found
if 'CONFIG_NUMA' in config_host
numa = declare_dependency(link_args: config_host['NUMA_LIBS'].split())
endif
xen = not_found xen = not_found
if 'CONFIG_XEN_BACKEND' in config_host if 'CONFIG_XEN_BACKEND' in config_host
xen = declare_dependency(compile_args: config_host['XEN_CFLAGS'].split(), xen = declare_dependency(compile_args: config_host['XEN_CFLAGS'].split(),
@ -1236,7 +1274,7 @@ selinux = dependency('libselinux',
malloc = [] malloc = []
if get_option('malloc') == 'system' if get_option('malloc') == 'system'
has_malloc_trim = \ has_malloc_trim = \
not get_option('malloc_trim').disabled() and \ get_option('malloc_trim').allowed() and \
cc.links('''#include <malloc.h> cc.links('''#include <malloc.h>
int main(void) { malloc_trim(0); return 0; }''') int main(void) { malloc_trim(0); return 0; }''')
else else
@ -1268,19 +1306,13 @@ statx_test = gnu_source_prefix + '''
has_statx = cc.links(statx_test) has_statx = cc.links(statx_test)
have_vhost_user_blk_server = (targetos == 'linux' and have_vhost_user_blk_server = get_option('vhost_user_blk_server') \
'CONFIG_VHOST_USER' in config_host) .require(targetos == 'linux',
error_message: 'vhost_user_blk_server requires linux') \
if get_option('vhost_user_blk_server').enabled() .require('CONFIG_VHOST_USER' in config_host,
if targetos != 'linux' error_message: 'vhost_user_blk_server requires vhost-user support') \
error('vhost_user_blk_server requires linux') .disable_auto_if(not have_system) \
elif 'CONFIG_VHOST_USER' not in config_host .allowed()
error('vhost_user_blk_server requires vhost-user support')
endif
elif get_option('vhost_user_blk_server').disabled() or not have_system
have_vhost_user_blk_server = false
endif
if get_option('fuse').disabled() and get_option('fuse_lseek').enabled() if get_option('fuse').disabled() and get_option('fuse_lseek').enabled()
error('Cannot enable fuse-lseek while fuse is disabled') error('Cannot enable fuse-lseek while fuse is disabled')
@ -1291,7 +1323,7 @@ fuse = dependency('fuse3', required: get_option('fuse'),
kwargs: static_kwargs) kwargs: static_kwargs)
fuse_lseek = not_found fuse_lseek = not_found
if not get_option('fuse_lseek').disabled() if get_option('fuse_lseek').allowed()
if fuse.version().version_compare('>=3.8') if fuse.version().version_compare('>=3.8')
# Dummy dependency # Dummy dependency
fuse_lseek = declare_dependency() fuse_lseek = declare_dependency()
@ -1407,41 +1439,33 @@ endif
have_host_block_device = (targetos != 'darwin' or have_host_block_device = (targetos != 'darwin' or
cc.has_header('IOKit/storage/IOMedia.h')) cc.has_header('IOKit/storage/IOMedia.h'))
dbus_display = false # FIXME enable_modules shouldn't be necessary, but: https://github.com/mesonbuild/meson/issues/8333
if not get_option('dbus_display').disabled() dbus_display = get_option('dbus_display') \
# FIXME enable_modules shouldn't be necessary, but: https://github.com/mesonbuild/meson/issues/8333 .require(gio.version().version_compare('>=2.64'),
dbus_display = gio.version().version_compare('>=2.64') and config_host.has_key('GDBUS_CODEGEN') and enable_modules error_message: '-display dbus requires glib>=2.64') \
if get_option('dbus_display').enabled() and not dbus_display .require(enable_modules,
error('Requirements missing to enable -display dbus (glib>=2.64 && --enable-modules)') error_message: '-display dbus requires --enable-modules') \
endif .require(config_host.has_key('GDBUS_CODEGEN'),
endif error_message: '-display dbus requires gdbus-codegen') \
.allowed()
have_virtfs = (targetos == 'linux' and have_virtfs = get_option('virtfs') \
have_system and .require(targetos == 'linux',
libattr.found() and error_message: 'virtio-9p (virtfs) requires Linux') \
libcap_ng.found()) .require(libattr.found() and libcap_ng.found(),
error_message: 'virtio-9p (virtfs) requires libcap-ng-devel and libattr-devel') \
.disable_auto_if(not have_tools and not have_system) \
.allowed()
have_virtfs_proxy_helper = have_virtfs and have_tools have_virtfs_proxy_helper = have_virtfs and have_tools
if get_option('virtfs').enabled()
if not have_virtfs
if targetos != 'linux'
error('virtio-9p (virtfs) requires Linux')
elif not libcap_ng.found() or not libattr.found()
error('virtio-9p (virtfs) requires libcap-ng-devel and libattr-devel')
elif not have_system
error('virtio-9p (virtfs) needs system emulation support')
endif
endif
elif get_option('virtfs').disabled()
have_virtfs = false
endif
foreach k : get_option('trace_backends') foreach k : get_option('trace_backends')
config_host_data.set('CONFIG_TRACE_' + k.to_upper(), true) config_host_data.set('CONFIG_TRACE_' + k.to_upper(), true)
endforeach endforeach
config_host_data.set_quoted('CONFIG_TRACE_FILE', get_option('trace_file')) config_host_data.set_quoted('CONFIG_TRACE_FILE', get_option('trace_file'))
if get_option('iasl') != ''
config_host_data.set_quoted('CONFIG_IASL', get_option('iasl'))
endif
config_host_data.set_quoted('CONFIG_BINDIR', get_option('prefix') / get_option('bindir')) config_host_data.set_quoted('CONFIG_BINDIR', get_option('prefix') / get_option('bindir'))
config_host_data.set_quoted('CONFIG_PREFIX', get_option('prefix')) config_host_data.set_quoted('CONFIG_PREFIX', get_option('prefix'))
config_host_data.set_quoted('CONFIG_QEMU_CONFDIR', get_option('prefix') / qemu_confdir) config_host_data.set_quoted('CONFIG_QEMU_CONFDIR', get_option('prefix') / qemu_confdir)
@ -1455,9 +1479,21 @@ config_host_data.set_quoted('CONFIG_QEMU_LOCALSTATEDIR', get_option('prefix') /
config_host_data.set_quoted('CONFIG_QEMU_MODDIR', get_option('prefix') / qemu_moddir) config_host_data.set_quoted('CONFIG_QEMU_MODDIR', get_option('prefix') / qemu_moddir)
config_host_data.set_quoted('CONFIG_SYSCONFDIR', get_option('prefix') / get_option('sysconfdir')) config_host_data.set_quoted('CONFIG_SYSCONFDIR', get_option('prefix') / get_option('sysconfdir'))
have_slirp_smbd = get_option('slirp_smbd') \
.require(targetos != 'windows', error_message: 'Host smbd not supported on this platform.') \
.allowed()
if have_slirp_smbd
smbd_path = get_option('smbd')
if smbd_path == ''
smbd_path = (targetos == 'solaris' ? '/usr/sfw/sbin/smbd' : '/usr/sbin/smbd')
endif
config_host_data.set_quoted('CONFIG_SMBD_COMMAND', smbd_path)
endif
config_host_data.set('HOST_' + host_arch.to_upper(), 1) config_host_data.set('HOST_' + host_arch.to_upper(), 1)
config_host_data.set('CONFIG_ATTR', libattr.found()) config_host_data.set('CONFIG_ATTR', libattr.found())
config_host_data.set('CONFIG_BDRV_WHITELIST_TOOLS', get_option('block_drv_whitelist_in_tools'))
config_host_data.set('CONFIG_BRLAPI', brlapi.found()) config_host_data.set('CONFIG_BRLAPI', brlapi.found())
config_host_data.set('CONFIG_COCOA', cocoa.found()) config_host_data.set('CONFIG_COCOA', cocoa.found())
config_host_data.set('CONFIG_FUZZ', get_option('fuzzing')) config_host_data.set('CONFIG_FUZZ', get_option('fuzzing'))
@ -1490,11 +1526,14 @@ config_host_data.set('CONFIG_LIBSSH', libssh.found())
config_host_data.set('CONFIG_LINUX_AIO', libaio.found()) config_host_data.set('CONFIG_LINUX_AIO', libaio.found())
config_host_data.set('CONFIG_LINUX_IO_URING', linux_io_uring.found()) config_host_data.set('CONFIG_LINUX_IO_URING', linux_io_uring.found())
config_host_data.set('CONFIG_LIBPMEM', libpmem.found()) config_host_data.set('CONFIG_LIBPMEM', libpmem.found())
config_host_data.set('CONFIG_NUMA', numa.found())
config_host_data.set('CONFIG_PROFILER', get_option('profiler'))
config_host_data.set('CONFIG_RBD', rbd.found()) config_host_data.set('CONFIG_RBD', rbd.found())
config_host_data.set('CONFIG_SDL', sdl.found()) config_host_data.set('CONFIG_SDL', sdl.found())
config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found()) config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found())
config_host_data.set('CONFIG_SECCOMP', seccomp.found()) config_host_data.set('CONFIG_SECCOMP', seccomp.found())
config_host_data.set('CONFIG_SNAPPY', snappy.found()) config_host_data.set('CONFIG_SNAPPY', snappy.found())
config_host_data.set('CONFIG_TPM', have_tpm)
config_host_data.set('CONFIG_USB_LIBUSB', libusb.found()) config_host_data.set('CONFIG_USB_LIBUSB', libusb.found())
config_host_data.set('CONFIG_VDE', vde.found()) config_host_data.set('CONFIG_VDE', vde.found())
config_host_data.set('CONFIG_VHOST_USER_BLK_SERVER', have_vhost_user_blk_server) config_host_data.set('CONFIG_VHOST_USER_BLK_SERVER', have_vhost_user_blk_server)
@ -1537,6 +1576,19 @@ config_host_data.set_quoted('CONFIG_HOST_DSOSUF', host_dsosuf)
config_host_data.set('HAVE_HOST_BLOCK_DEVICE', have_host_block_device) config_host_data.set('HAVE_HOST_BLOCK_DEVICE', have_host_block_device)
config_host_data.set('HOST_WORDS_BIGENDIAN', host_machine.endian() == 'big') config_host_data.set('HOST_WORDS_BIGENDIAN', host_machine.endian() == 'big')
have_coroutine_pool = get_option('coroutine_pool')
if get_option('debug_stack_usage') and have_coroutine_pool
message('Disabling coroutine pool to measure stack usage')
have_coroutine_pool = false
endif
config_host_data.set10('CONFIG_COROUTINE_POOL', have_coroutine_pool)
config_host_data.set('CONFIG_DEBUG_MUTEX', get_option('debug_mutex'))
config_host_data.set('CONFIG_DEBUG_STACK_USAGE', get_option('debug_stack_usage'))
config_host_data.set('CONFIG_GPROF', get_option('gprof'))
config_host_data.set('CONFIG_LIVE_BLOCK_MIGRATION', get_option('live_block_migration').allowed())
config_host_data.set('CONFIG_QOM_CAST_DEBUG', get_option('qom_cast_debug'))
config_host_data.set('CONFIG_REPLICATION', get_option('live_block_migration').allowed())
# has_header # has_header
config_host_data.set('CONFIG_EPOLL', cc.has_header('sys/epoll.h')) config_host_data.set('CONFIG_EPOLL', cc.has_header('sys/epoll.h'))
config_host_data.set('CONFIG_LINUX_MAGIC_H', cc.has_header('linux/magic.h')) config_host_data.set('CONFIG_LINUX_MAGIC_H', cc.has_header('linux/magic.h'))
@ -1714,7 +1766,7 @@ config_host_data.set('HAVE_MLOCKALL', cc.links(gnu_source_prefix + '''
}''')) }'''))
have_l2tpv3 = false have_l2tpv3 = false
if not get_option('l2tpv3').disabled() and have_system if get_option('l2tpv3').allowed() and have_system
have_l2tpv3 = cc.has_type('struct mmsghdr', have_l2tpv3 = cc.has_type('struct mmsghdr',
prefix: gnu_source_prefix + ''' prefix: gnu_source_prefix + '''
#include <sys/socket.h> #include <sys/socket.h>
@ -1723,7 +1775,7 @@ endif
config_host_data.set('CONFIG_L2TPV3', have_l2tpv3) config_host_data.set('CONFIG_L2TPV3', have_l2tpv3)
have_netmap = false have_netmap = false
if not get_option('netmap').disabled() and have_system if get_option('netmap').allowed() and have_system
have_netmap = cc.compiles(''' have_netmap = cc.compiles('''
#include <inttypes.h> #include <inttypes.h>
#include <net/if.h> #include <net/if.h>
@ -1780,6 +1832,86 @@ config_host_data.set('CONFIG_GETAUXVAL', cc.links(gnu_source_prefix + '''
return getauxval(AT_HWCAP) == 0; return getauxval(AT_HWCAP) == 0;
}''')) }'''))
have_cpuid_h = cc.links('''
#include <cpuid.h>
int main(void) {
unsigned a, b, c, d;
unsigned max = __get_cpuid_max(0, 0);
if (max >= 1) {
__cpuid(1, a, b, c, d);
}
if (max >= 7) {
__cpuid_count(7, 0, a, b, c, d);
}
return 0;
}''')
config_host_data.set('CONFIG_CPUID_H', have_cpuid_h)
config_host_data.set('CONFIG_AVX2_OPT', get_option('avx2') \
.require(have_cpuid_h, error_message: 'cpuid.h not available, cannot enable AVX2') \
.require(cc.links('''
#pragma GCC push_options
#pragma GCC target("avx2")
#include <cpuid.h>
#include <immintrin.h>
static int bar(void *a) {
__m256i x = *(__m256i *)a;
return _mm256_testz_si256(x, x);
}
int main(int argc, char *argv[]) { return bar(argv[0]); }
'''), error_message: 'AVX2 not available').allowed())
config_host_data.set('CONFIG_AVX512F_OPT', get_option('avx512f') \
.require(have_cpuid_h, error_message: 'cpuid.h not available, cannot enable AVX512F') \
.require(cc.links('''
#pragma GCC push_options
#pragma GCC target("avx512f")
#include <cpuid.h>
#include <immintrin.h>
static int bar(void *a) {
__m512i x = *(__m512i *)a;
return _mm512_test_epi64_mask(x, x);
}
int main(int argc, char *argv[]) { return bar(argv[0]); }
'''), error_message: 'AVX512F not available').allowed())
if get_option('membarrier').disabled()
have_membarrier = false
elif targetos == 'windows'
have_membarrier = true
elif targetos == 'linux'
have_membarrier = cc.compiles('''
#include <linux/membarrier.h>
#include <sys/syscall.h>
#include <unistd.h>
#include <stdlib.h>
int main(void) {
syscall(__NR_membarrier, MEMBARRIER_CMD_QUERY, 0);
syscall(__NR_membarrier, MEMBARRIER_CMD_SHARED, 0);
exit(0);
}''')
endif
config_host_data.set('CONFIG_MEMBARRIER', get_option('membarrier') \
.require(have_membarrier, error_message: 'membarrier system call not available') \
.allowed())
have_afalg = get_option('crypto_afalg') \
.require(cc.compiles(gnu_source_prefix + '''
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <linux/if_alg.h>
int main(void) {
int sock;
sock = socket(AF_ALG, SOCK_SEQPACKET, 0);
return sock;
}
'''), error_message: 'AF_ALG requested but could not be detected').allowed()
config_host_data.set('CONFIG_AF_ALG', have_afalg)
config_host_data.set('CONFIG_AF_VSOCK', cc.compiles(gnu_source_prefix + ''' config_host_data.set('CONFIG_AF_VSOCK', cc.compiles(gnu_source_prefix + '''
#include <errno.h> #include <errno.h>
#include <sys/types.h> #include <sys/types.h>
@ -1800,10 +1932,33 @@ config_host_data.set('CONFIG_AF_VSOCK', cc.compiles(gnu_source_prefix + '''
return -1; return -1;
}''')) }'''))
have_vss = false
if targetos == 'windows' and link_language == 'cpp'
have_vss = cxx.compiles('''
#define __MIDL_user_allocate_free_DEFINED__
#include <inc/win2003/vss.h>
int main(void) { return VSS_CTX_BACKUP; }''')
endif
have_ntddscsi = false
if targetos == 'windows'
have_ntddscsi = cc.compiles('''
#include <windows.h>
#include <ntddscsi.h>
int main(void) {
#if !defined(IOCTL_SCSI_GET_ADDRESS)
#error Missing required ioctl definitions
#endif
SCSI_ADDRESS addr = { .Lun = 0, .TargetId = 0, .PathId = 0 };
return addr.Lun;
}
''')
endif
config_host_data.set('HAVE_NTDDSCSI', have_ntddscsi)
ignored = ['CONFIG_QEMU_INTERP_PREFIX', # actually per-target ignored = ['CONFIG_QEMU_INTERP_PREFIX', # actually per-target
'HAVE_GDB_BIN'] 'HAVE_GDB_BIN']
arrays = ['CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST'] arrays = ['CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST']
strings = ['CONFIG_IASL']
foreach k, v: config_host foreach k, v: config_host
if ignored.contains(k) if ignored.contains(k)
# do nothing # do nothing
@ -1812,8 +1967,6 @@ foreach k, v: config_host
v = '"' + '", "'.join(v.split()) + '", ' v = '"' + '", "'.join(v.split()) + '", '
endif endif
config_host_data.set(k, v) config_host_data.set(k, v)
elif strings.contains(k)
config_host_data.set_quoted(k, v)
elif k.startswith('CONFIG_') elif k.startswith('CONFIG_')
config_host_data.set(k, v == 'y' ? 1 : v) config_host_data.set(k, v == 'y' ? 1 : v)
endif endif
@ -1865,7 +2018,7 @@ endif
have_ivshmem = config_host_data.get('CONFIG_EVENTFD') have_ivshmem = config_host_data.get('CONFIG_EVENTFD')
host_kconfig = \ host_kconfig = \
(get_option('fuzzing') ? ['CONFIG_FUZZ=y'] : []) + \ (get_option('fuzzing') ? ['CONFIG_FUZZ=y'] : []) + \
('CONFIG_TPM' in config_host ? ['CONFIG_TPM=y'] : []) + \ (have_tpm ? ['CONFIG_TPM=y'] : []) + \
(spice.found() ? ['CONFIG_SPICE=y'] : []) + \ (spice.found() ? ['CONFIG_SPICE=y'] : []) + \
(have_ivshmem ? ['CONFIG_IVSHMEM=y'] : []) + \ (have_ivshmem ? ['CONFIG_IVSHMEM=y'] : []) + \
('CONFIG_OPENGL' in config_host ? ['CONFIG_OPENGL=y'] : []) + \ ('CONFIG_OPENGL' in config_host ? ['CONFIG_OPENGL=y'] : []) + \
@ -2602,7 +2755,9 @@ if have_block
'job.c', 'job.c',
'qemu-io-cmds.c', 'qemu-io-cmds.c',
)) ))
block_ss.add(when: 'CONFIG_REPLICATION', if_true: files('replication.c')) if config_host_data.get('CONFIG_REPLICATION')
block_ss.add(files('replication.c'))
endif
subdir('nbd') subdir('nbd')
subdir('scsi') subdir('scsi')
@ -3097,11 +3252,7 @@ if 'CONFIG_PLUGIN' in config_host
install_headers('include/qemu/qemu-plugin.h') install_headers('include/qemu/qemu-plugin.h')
endif endif
if 'CONFIG_GUEST_AGENT' in config_host subdir('qga')
subdir('qga')
elif get_option('guest_agent_msi').enabled()
error('Guest agent MSI requested, but the guest agent is not being built')
endif
# Don't build qemu-keymap if xkbcommon is not explicitly enabled # Don't build qemu-keymap if xkbcommon is not explicitly enabled
# when we don't build tools or system # when we don't build tools or system
@ -3223,12 +3374,17 @@ summary_info += {'sphinx-build': sphinx_build}
if config_host.has_key('HAVE_GDB_BIN') if config_host.has_key('HAVE_GDB_BIN')
summary_info += {'gdb': config_host['HAVE_GDB_BIN']} summary_info += {'gdb': config_host['HAVE_GDB_BIN']}
endif endif
if get_option('iasl') != ''
summary_info += {'iasl': get_option('iasl')}
else
summary_info += {'iasl': false}
endif
summary_info += {'genisoimage': config_host['GENISOIMAGE']} summary_info += {'genisoimage': config_host['GENISOIMAGE']}
if targetos == 'windows' and config_host.has_key('CONFIG_GUEST_AGENT') if targetos == 'windows' and have_ga
summary_info += {'wixl': wixl} summary_info += {'wixl': wixl}
endif endif
if slirp_opt != 'disabled' and 'CONFIG_SLIRP_SMBD' in config_host if slirp_opt != 'disabled' and have_system
summary_info += {'smbd': config_host['CONFIG_SMBD_COMMAND']} summary_info += {'smbd': have_slirp_smbd ? smbd_path : false}
endif endif
summary(summary_info, bool_yn: true, section: 'Host binaries') summary(summary_info, bool_yn: true, section: 'Host binaries')
@ -3252,7 +3408,7 @@ if 'simple' in get_option('trace_backends')
summary_info += {'Trace output file': get_option('trace_file') + '-<pid>'} summary_info += {'Trace output file': get_option('trace_file') + '-<pid>'}
endif endif
summary_info += {'D-Bus display': dbus_display} summary_info += {'D-Bus display': dbus_display}
summary_info += {'QOM debugging': config_host.has_key('CONFIG_QOM_CAST_DEBUG')} summary_info += {'QOM debugging': get_option('qom_cast_debug')}
summary_info += {'vhost-kernel support': config_host.has_key('CONFIG_VHOST_KERNEL')} summary_info += {'vhost-kernel support': config_host.has_key('CONFIG_VHOST_KERNEL')}
summary_info += {'vhost-net support': config_host.has_key('CONFIG_VHOST_NET')} summary_info += {'vhost-net support': config_host.has_key('CONFIG_VHOST_NET')}
summary_info += {'vhost-crypto support': config_host.has_key('CONFIG_VHOST_CRYPTO')} summary_info += {'vhost-crypto support': config_host.has_key('CONFIG_VHOST_CRYPTO')}
@ -3262,7 +3418,7 @@ summary_info += {'vhost-user support': config_host.has_key('CONFIG_VHOST_USER')}
summary_info += {'vhost-user-blk server support': have_vhost_user_blk_server} summary_info += {'vhost-user-blk server support': have_vhost_user_blk_server}
summary_info += {'vhost-user-fs support': config_host.has_key('CONFIG_VHOST_USER_FS')} summary_info += {'vhost-user-fs support': config_host.has_key('CONFIG_VHOST_USER_FS')}
summary_info += {'vhost-vdpa support': config_host.has_key('CONFIG_VHOST_VDPA')} summary_info += {'vhost-vdpa support': config_host.has_key('CONFIG_VHOST_VDPA')}
summary_info += {'build guest agent': config_host.has_key('CONFIG_GUEST_AGENT')} summary_info += {'build guest agent': have_ga}
summary(summary_info, bool_yn: true, section: 'Configurable features') summary(summary_info, bool_yn: true, section: 'Configurable features')
# Compilation information # Compilation information
@ -3279,11 +3435,6 @@ endif
if targetos == 'darwin' if targetos == 'darwin'
summary_info += {'Objective-C compiler': ' '.join(meson.get_compiler('objc').cmd_array())} summary_info += {'Objective-C compiler': ' '.join(meson.get_compiler('objc').cmd_array())}
endif endif
if targetos == 'windows'
if 'WIN_SDK' in config_host
summary_info += {'Windows SDK': config_host['WIN_SDK']}
endif
endif
summary_info += {'CFLAGS': ' '.join(get_option('c_args') summary_info += {'CFLAGS': ' '.join(get_option('c_args')
+ ['-O' + get_option('optimization')] + ['-O' + get_option('optimization')]
+ (get_option('debug') ? ['-g'] : []))} + (get_option('debug') ? ['-g'] : []))}
@ -3298,18 +3449,18 @@ if link_args.length() > 0
endif endif
summary_info += {'QEMU_CFLAGS': config_host['QEMU_CFLAGS']} summary_info += {'QEMU_CFLAGS': config_host['QEMU_CFLAGS']}
summary_info += {'QEMU_LDFLAGS': config_host['QEMU_LDFLAGS']} summary_info += {'QEMU_LDFLAGS': config_host['QEMU_LDFLAGS']}
summary_info += {'profiler': config_host.has_key('CONFIG_PROFILER')} summary_info += {'profiler': get_option('profiler')}
summary_info += {'link-time optimization (LTO)': get_option('b_lto')} summary_info += {'link-time optimization (LTO)': get_option('b_lto')}
summary_info += {'PIE': get_option('b_pie')} summary_info += {'PIE': get_option('b_pie')}
summary_info += {'static build': config_host.has_key('CONFIG_STATIC')} summary_info += {'static build': config_host.has_key('CONFIG_STATIC')}
summary_info += {'malloc trim support': has_malloc_trim} summary_info += {'malloc trim support': has_malloc_trim}
summary_info += {'membarrier': config_host.has_key('CONFIG_MEMBARRIER')} summary_info += {'membarrier': have_membarrier}
summary_info += {'debug stack usage': config_host.has_key('CONFIG_DEBUG_STACK_USAGE')} summary_info += {'debug stack usage': get_option('debug_stack_usage')}
summary_info += {'mutex debugging': config_host.has_key('CONFIG_DEBUG_MUTEX')} summary_info += {'mutex debugging': get_option('debug_mutex')}
summary_info += {'memory allocator': get_option('malloc')} summary_info += {'memory allocator': get_option('malloc')}
summary_info += {'avx2 optimization': config_host.has_key('CONFIG_AVX2_OPT')} summary_info += {'avx2 optimization': config_host_data.get('CONFIG_AVX2_OPT')}
summary_info += {'avx512f optimization': config_host.has_key('CONFIG_AVX512F_OPT')} summary_info += {'avx512f optimization': config_host_data.get('CONFIG_AVX512F_OPT')}
summary_info += {'gprof enabled': config_host.has_key('CONFIG_GPROF')} summary_info += {'gprof enabled': get_option('gprof')}
summary_info += {'gcov': get_option('b_coverage')} summary_info += {'gcov': get_option('b_coverage')}
summary_info += {'thread sanitizer': config_host.has_key('CONFIG_TSAN')} summary_info += {'thread sanitizer': config_host.has_key('CONFIG_TSAN')}
summary_info += {'CFI support': get_option('cfi')} summary_info += {'CFI support': get_option('cfi')}
@ -3372,23 +3523,23 @@ summary(summary_info, bool_yn: true, section: 'Targets and accelerators')
# Block layer # Block layer
summary_info = {} summary_info = {}
summary_info += {'coroutine backend': config_host['CONFIG_COROUTINE_BACKEND']} summary_info += {'coroutine backend': config_host['CONFIG_COROUTINE_BACKEND']}
summary_info += {'coroutine pool': config_host['CONFIG_COROUTINE_POOL'] == '1'} summary_info += {'coroutine pool': have_coroutine_pool}
if have_block if have_block
summary_info += {'Block whitelist (rw)': config_host['CONFIG_BDRV_RW_WHITELIST']} summary_info += {'Block whitelist (rw)': config_host['CONFIG_BDRV_RW_WHITELIST']}
summary_info += {'Block whitelist (ro)': config_host['CONFIG_BDRV_RO_WHITELIST']} summary_info += {'Block whitelist (ro)': config_host['CONFIG_BDRV_RO_WHITELIST']}
summary_info += {'Use block whitelist in tools': config_host.has_key('CONFIG_BDRV_WHITELIST_TOOLS')} summary_info += {'Use block whitelist in tools': get_option('block_drv_whitelist_in_tools')}
summary_info += {'VirtFS support': have_virtfs} summary_info += {'VirtFS support': have_virtfs}
summary_info += {'build virtiofs daemon': have_virtiofsd} summary_info += {'build virtiofs daemon': have_virtiofsd}
summary_info += {'Live block migration': config_host.has_key('CONFIG_LIVE_BLOCK_MIGRATION')} summary_info += {'Live block migration': config_host_data.get('CONFIG_LIVE_BLOCK_MIGRATION')}
summary_info += {'replication support': config_host.has_key('CONFIG_REPLICATION')} summary_info += {'replication support': config_host_data.get('CONFIG_REPLICATION')}
summary_info += {'bochs support': config_host.has_key('CONFIG_BOCHS')} summary_info += {'bochs support': get_option('bochs').allowed()}
summary_info += {'cloop support': config_host.has_key('CONFIG_CLOOP')} summary_info += {'cloop support': get_option('cloop').allowed()}
summary_info += {'dmg support': config_host.has_key('CONFIG_DMG')} summary_info += {'dmg support': get_option('dmg').allowed()}
summary_info += {'qcow v1 support': config_host.has_key('CONFIG_QCOW1')} summary_info += {'qcow v1 support': get_option('qcow1').allowed()}
summary_info += {'vdi support': config_host.has_key('CONFIG_VDI')} summary_info += {'vdi support': get_option('vdi').allowed()}
summary_info += {'vvfat support': config_host.has_key('CONFIG_VVFAT')} summary_info += {'vvfat support': get_option('vvfat').allowed()}
summary_info += {'qed support': config_host.has_key('CONFIG_QED')} summary_info += {'qed support': get_option('qed').allowed()}
summary_info += {'parallels support': config_host.has_key('CONFIG_PARALLELS')} summary_info += {'parallels support': get_option('parallels').allowed()}
summary_info += {'FUSE exports': fuse} summary_info += {'FUSE exports': fuse}
endif endif
summary(summary_info, bool_yn: true, section: 'Block layer support') summary(summary_info, bool_yn: true, section: 'Block layer support')
@ -3405,8 +3556,8 @@ summary_info += {'nettle': nettle}
if nettle.found() if nettle.found()
summary_info += {' XTS': xts != 'private'} summary_info += {' XTS': xts != 'private'}
endif endif
summary_info += {'crypto afalg': config_host.has_key('CONFIG_AF_ALG')} summary_info += {'AF_ALG support': have_afalg}
summary_info += {'rng-none': config_host.has_key('CONFIG_RNG_NONE')} summary_info += {'rng-none': get_option('rng_none')}
summary_info += {'Linux keyring': config_host.has_key('CONFIG_SECRET_KEYRING')} summary_info += {'Linux keyring': config_host.has_key('CONFIG_SECRET_KEYRING')}
summary(summary_info, bool_yn: true, section: 'Crypto') summary(summary_info, bool_yn: true, section: 'Crypto')
@ -3472,21 +3623,21 @@ summary_info += {'GBM': gbm}
summary_info += {'libiscsi support': libiscsi} summary_info += {'libiscsi support': libiscsi}
summary_info += {'libnfs support': libnfs} summary_info += {'libnfs support': libnfs}
if targetos == 'windows' if targetos == 'windows'
if config_host.has_key('CONFIG_GUEST_AGENT') if have_ga
summary_info += {'QGA VSS support': config_host.has_key('CONFIG_QGA_VSS')} summary_info += {'QGA VSS support': have_qga_vss}
summary_info += {'QGA w32 disk info': config_host.has_key('CONFIG_QGA_NTDDSCSI')} summary_info += {'QGA w32 disk info': have_ntddscsi}
endif endif
endif endif
summary_info += {'seccomp support': seccomp} summary_info += {'seccomp support': seccomp}
summary_info += {'GlusterFS support': glusterfs} summary_info += {'GlusterFS support': glusterfs}
summary_info += {'TPM support': config_host.has_key('CONFIG_TPM')} summary_info += {'TPM support': have_tpm}
summary_info += {'libssh support': libssh} summary_info += {'libssh support': libssh}
summary_info += {'lzo support': lzo} summary_info += {'lzo support': lzo}
summary_info += {'snappy support': snappy} summary_info += {'snappy support': snappy}
summary_info += {'bzip2 support': libbzip2} summary_info += {'bzip2 support': libbzip2}
summary_info += {'lzfse support': liblzfse} summary_info += {'lzfse support': liblzfse}
summary_info += {'zstd support': zstd} summary_info += {'zstd support': zstd}
summary_info += {'NUMA host support': config_host.has_key('CONFIG_NUMA')} summary_info += {'NUMA host support': numa}
summary_info += {'capstone': capstone_opt == 'internal' ? capstone_opt : capstone} summary_info += {'capstone': capstone_opt == 'internal' ? capstone_opt : capstone}
summary_info += {'libpmem support': libpmem} summary_info += {'libpmem support': libpmem}
summary_info += {'libdaxctl support': libdaxctl} summary_info += {'libdaxctl support': libdaxctl}

View File

@ -8,8 +8,12 @@ option('docdir', type : 'string', value : 'doc',
description: 'Base directory for documentation installation (can be empty)') description: 'Base directory for documentation installation (can be empty)')
option('qemu_firmwarepath', type : 'string', value : '', option('qemu_firmwarepath', type : 'string', value : '',
description: 'search PATH for firmware files') description: 'search PATH for firmware files')
option('smbd', type : 'string', value : '',
description: 'Path to smbd for slirp networking')
option('sphinx_build', type : 'string', value : '', option('sphinx_build', type : 'string', value : '',
description: 'Use specified sphinx-build [$sphinx_build] for building document (default to be empty)') description: 'Use specified sphinx-build [$sphinx_build] for building document (default to be empty)')
option('iasl', type : 'string', value : '',
description: 'Path to ACPI disassembler')
option('default_devices', type : 'boolean', value : true, option('default_devices', type : 'boolean', value : true,
description: 'Include a default selection of devices in emulators') description: 'Include a default selection of devices in emulators')
option('audio_drv_list', type: 'array', value: ['default'], option('audio_drv_list', type: 'array', value: ['default'],
@ -34,8 +38,14 @@ option('install_blobs', type : 'boolean', value : true,
description: 'install provided firmware blobs') description: 'install provided firmware blobs')
option('sparse', type : 'feature', value : 'auto', option('sparse', type : 'feature', value : 'auto',
description: 'sparse checker') description: 'sparse checker')
option('guest_agent', type : 'feature', value : 'auto',
description: 'Build QEMU Guest Agent')
option('guest_agent_msi', type : 'feature', value : 'auto', option('guest_agent_msi', type : 'feature', value : 'auto',
description: 'Build MSI package for the QEMU Guest Agent') description: 'Build MSI package for the QEMU Guest Agent')
option('tools', type : 'feature', value : 'auto',
description: 'build support utilities that come with QEMU')
option('qga_vss', type : 'feature', value: 'auto',
description: 'build QGA VSS support (broken with MinGW)')
option('malloc_trim', type : 'feature', value : 'auto', option('malloc_trim', type : 'feature', value : 'auto',
description: 'enable libc malloc_trim() for memory optimization') description: 'enable libc malloc_trim() for memory optimization')
@ -68,6 +78,18 @@ option('multiprocess', type: 'feature', value: 'auto',
description: 'Out of process device emulation support') description: 'Out of process device emulation support')
option('dbus_display', type: 'feature', value: 'auto', option('dbus_display', type: 'feature', value: 'auto',
description: '-display dbus support') description: '-display dbus support')
option('tpm', type : 'feature', value : 'auto',
description: 'TPM support')
# Do not enable it by default even for Mingw32, because it doesn't
# work on Wine.
option('membarrier', type: 'feature', value: 'disabled',
description: 'membarrier system call (for Linux 4.14+ or Windows')
option('avx2', type: 'feature', value: 'auto',
description: 'AVX2 optimizations')
option('avx512f', type: 'feature', value: 'disabled',
description: 'AVX512F optimizations')
option('attr', type : 'feature', value : 'auto', option('attr', type : 'feature', value : 'auto',
description: 'attr/xattr support') description: 'attr/xattr support')
@ -93,6 +115,8 @@ option('libnfs', type : 'feature', value : 'auto',
description: 'libnfs block device driver') description: 'libnfs block device driver')
option('mpath', type : 'feature', value : 'auto', option('mpath', type : 'feature', value : 'auto',
description: 'Multipath persistent reservation passthrough') description: 'Multipath persistent reservation passthrough')
option('numa', type : 'feature', value : 'auto',
description: 'libnuma support')
option('iconv', type : 'feature', value : 'auto', option('iconv', type : 'feature', value : 'auto',
description: 'Font glyph conversion support') description: 'Font glyph conversion support')
option('curses', type : 'feature', value : 'auto', option('curses', type : 'feature', value : 'auto',
@ -103,6 +127,8 @@ option('nettle', type : 'feature', value : 'auto',
description: 'nettle cryptography support') description: 'nettle cryptography support')
option('gcrypt', type : 'feature', value : 'auto', option('gcrypt', type : 'feature', value : 'auto',
description: 'libgcrypt cryptography support') description: 'libgcrypt cryptography support')
option('crypto_afalg', type : 'feature', value : 'disabled',
description: 'Linux AF_ALG crypto backend driver')
option('libdaxctl', type : 'feature', value : 'auto', option('libdaxctl', type : 'feature', value : 'auto',
description: 'libdaxctl support') description: 'libdaxctl support')
option('libpmem', type : 'feature', value : 'auto', option('libpmem', type : 'feature', value : 'auto',
@ -206,3 +232,41 @@ option('fdt', type: 'combo', value: 'auto',
option('selinux', type: 'feature', value: 'auto', option('selinux', type: 'feature', value: 'auto',
description: 'SELinux support in qemu-nbd') description: 'SELinux support in qemu-nbd')
option('live_block_migration', type: 'feature', value: 'auto',
description: 'block migration in the main migration stream')
option('replication', type: 'feature', value: 'auto',
description: 'replication support')
option('bochs', type: 'feature', value: 'auto',
description: 'bochs image format support')
option('cloop', type: 'feature', value: 'auto',
description: 'cloop image format support')
option('dmg', type: 'feature', value: 'auto',
description: 'dmg image format support')
option('qcow1', type: 'feature', value: 'auto',
description: 'qcow1 image format support')
option('vdi', type: 'feature', value: 'auto',
description: 'vdi image format support')
option('vvfat', type: 'feature', value: 'auto',
description: 'vvfat image format support')
option('qed', type: 'feature', value: 'auto',
description: 'qed image format support')
option('parallels', type: 'feature', value: 'auto',
description: 'parallels image format support')
option('block_drv_whitelist_in_tools', type: 'boolean', value: false,
description: 'use block whitelist also in tools instead of only QEMU')
option('rng_none', type: 'boolean', value: false,
description: 'dummy RNG, avoid using /dev/(u)random and getrandom()')
option('coroutine_pool', type: 'boolean', value: true,
description: 'coroutine freelist (better performance)')
option('debug_mutex', type: 'boolean', value: false,
description: 'mutex debugging support')
option('debug_stack_usage', type: 'boolean', value: false,
description: 'measure coroutine stack usage')
option('qom_cast_debug', type: 'boolean', value: false,
description: 'cast debugging support')
option('gprof', type: 'boolean', value: false,
description: 'QEMU profiling with gprof')
option('profiler', type: 'boolean', value: false,
description: 'profiler support')
option('slirp_smbd', type : 'feature', value : 'auto',
description: 'use smbd (at path --smbd=*) in slirp networking')

View File

@ -28,7 +28,9 @@ softmmu_ss.add(files(
), gnutls) ), gnutls)
softmmu_ss.add(when: ['CONFIG_RDMA', rdma], if_true: files('rdma.c')) softmmu_ss.add(when: ['CONFIG_RDMA', rdma], if_true: files('rdma.c'))
softmmu_ss.add(when: 'CONFIG_LIVE_BLOCK_MIGRATION', if_true: files('block.c')) if get_option('live_block_migration').allowed()
softmmu_ss.add(files('block.c'))
endif
softmmu_ss.add(when: zstd, if_true: files('multifd-zstd.c')) softmmu_ss.add(when: zstd, if_true: files('multifd-zstd.c'))
specific_ss.add(when: 'CONFIG_SOFTMMU', specific_ss.add(when: 'CONFIG_SOFTMMU',

View File

@ -27,7 +27,7 @@
#include "net/slirp.h" #include "net/slirp.h"
#if defined(CONFIG_SLIRP_SMBD) #if defined(CONFIG_SMBD_COMMAND)
#include <pwd.h> #include <pwd.h>
#include <sys/wait.h> #include <sys/wait.h>
#endif #endif
@ -91,7 +91,7 @@ typedef struct SlirpState {
Slirp *slirp; Slirp *slirp;
Notifier poll_notifier; Notifier poll_notifier;
Notifier exit_notifier; Notifier exit_notifier;
#if defined(CONFIG_SLIRP_SMBD) #if defined(CONFIG_SMBD_COMMAND)
gchar *smb_dir; gchar *smb_dir;
#endif #endif
GSList *fwd; GSList *fwd;
@ -104,7 +104,7 @@ static QTAILQ_HEAD(, SlirpState) slirp_stacks =
static int slirp_hostfwd(SlirpState *s, const char *redir_str, Error **errp); static int slirp_hostfwd(SlirpState *s, const char *redir_str, Error **errp);
static int slirp_guestfwd(SlirpState *s, const char *config_str, Error **errp); static int slirp_guestfwd(SlirpState *s, const char *config_str, Error **errp);
#if defined(CONFIG_SLIRP_SMBD) #if defined(CONFIG_SMBD_COMMAND)
static int slirp_smb(SlirpState *s, const char *exported_dir, static int slirp_smb(SlirpState *s, const char *exported_dir,
struct in_addr vserver_addr, Error **errp); struct in_addr vserver_addr, Error **errp);
static void slirp_smb_cleanup(SlirpState *s); static void slirp_smb_cleanup(SlirpState *s);
@ -377,7 +377,7 @@ static int net_slirp_init(NetClientState *peer, const char *model,
struct in6_addr ip6_prefix; struct in6_addr ip6_prefix;
struct in6_addr ip6_host; struct in6_addr ip6_host;
struct in6_addr ip6_dns; struct in6_addr ip6_dns;
#if defined(CONFIG_SLIRP_SMBD) #if defined(CONFIG_SMBD_COMMAND)
struct in_addr smbsrv = { .s_addr = 0 }; struct in_addr smbsrv = { .s_addr = 0 };
#endif #endif
NetClientState *nc; NetClientState *nc;
@ -487,7 +487,7 @@ static int net_slirp_init(NetClientState *peer, const char *model,
return -1; return -1;
} }
#if defined(CONFIG_SLIRP_SMBD) #if defined(CONFIG_SMBD_COMMAND)
if (vsmbserver && !inet_aton(vsmbserver, &smbsrv)) { if (vsmbserver && !inet_aton(vsmbserver, &smbsrv)) {
error_setg(errp, "Failed to parse SMB address"); error_setg(errp, "Failed to parse SMB address");
return -1; return -1;
@ -602,7 +602,7 @@ static int net_slirp_init(NetClientState *peer, const char *model,
} }
} }
} }
#if defined(CONFIG_SLIRP_SMBD) #if defined(CONFIG_SMBD_COMMAND)
if (smb_export) { if (smb_export) {
if (slirp_smb(s, smb_export, smbsrv, errp) < 0) { if (slirp_smb(s, smb_export, smbsrv, errp) < 0) {
goto error; goto error;
@ -794,7 +794,7 @@ void hmp_hostfwd_add(Monitor *mon, const QDict *qdict)
} }
#if defined(CONFIG_SLIRP_SMBD) #if defined(CONFIG_SMBD_COMMAND)
/* automatic user mode samba server configuration */ /* automatic user mode samba server configuration */
static void slirp_smb_cleanup(SlirpState *s) static void slirp_smb_cleanup(SlirpState *s)
@ -909,7 +909,7 @@ static int slirp_smb(SlirpState* s, const char *exported_dir,
return 0; return 0;
} }
#endif /* defined(CONFIG_SLIRP_SMBD) */ #endif /* defined(CONFIG_SMBD_COMMAND) */
static int guestfwd_can_read(void *opaque) static int guestfwd_can_read(void *opaque)
{ {

View File

@ -18,7 +18,7 @@
#include <ws2tcpip.h> #include <ws2tcpip.h>
#include <iptypes.h> #include <iptypes.h>
#include <iphlpapi.h> #include <iphlpapi.h>
#ifdef CONFIG_QGA_NTDDSCSI #ifdef HAVE_NTDDSCSI
#include <winioctl.h> #include <winioctl.h>
#include <ntddscsi.h> #include <ntddscsi.h>
#endif #endif
@ -474,7 +474,7 @@ void qmp_guest_file_flush(int64_t handle, Error **errp)
} }
} }
#ifdef CONFIG_QGA_NTDDSCSI #ifdef HAVE_NTDDSCSI
static GuestDiskBusType win2qemu[] = { static GuestDiskBusType win2qemu[] = {
[BusTypeUnknown] = GUEST_DISK_BUS_TYPE_UNKNOWN, [BusTypeUnknown] = GUEST_DISK_BUS_TYPE_UNKNOWN,
@ -1111,7 +1111,7 @@ GuestDiskInfoList *qmp_guest_get_disks(Error **errp)
return NULL; return NULL;
} }
#endif /* CONFIG_QGA_NTDDSCSI */ #endif /* HAVE_NTDDSCSI */
static GuestFilesystemInfo *build_guest_fsinfo(char *guid, Error **errp) static GuestFilesystemInfo *build_guest_fsinfo(char *guid, Error **errp)
{ {

View File

@ -1,3 +1,33 @@
if not have_ga
if get_option('guest_agent_msi').enabled()
error('Guest agent MSI requested, but the guest agent is not being built')
endif
have_qga_vss = false
subdir_done()
endif
have_qga_vss = get_option('qga_vss') \
.require(targetos == 'windows',
error_message: 'VSS support requires Windows') \
.require(link_language == 'cpp',
error_message: 'VSS support requires a C++ compiler') \
.require(have_vss, error_message: '''VSS support requires VSS headers.
If your Visual Studio installation doesn't have the VSS headers,
Please download and install Microsoft VSS SDK:
http://www.microsoft.com/en-us/download/details.aspx?id=23490
On POSIX-systems, MinGW doesn't yet provide working headers.
you can extract the SDK headers by:
$ scripts/extract-vsssdk-headers setup.exe
The headers are extracted in the directory 'inc/win2003'.
Then run configure with: --extra-cxxflags="-isystem /path/to/vss/inc/win2003"''') \
.require(midl.found() or widl.found(),
error_message: 'VSS support requires midl or widl') \
.require(not enable_static,
error_message: 'VSS support requires dynamic linking with GLib') \
.allowed()
all_qga = []
qga_qapi_outputs = [ qga_qapi_outputs = [
'qga-qapi-commands.c', 'qga-qapi-commands.c',
'qga-qapi-commands.h', 'qga-qapi-commands.h',
@ -50,19 +80,26 @@ qga_ss.add(when: 'CONFIG_WIN32', if_true: files(
qga_ss = qga_ss.apply(config_host, strict: false) qga_ss = qga_ss.apply(config_host, strict: false)
gen_tlb = []
qga_libs = []
if targetos == 'windows'
qga_libs += ['-lws2_32', '-lwinmm', '-lpowrprof', '-lwtsapi32', '-lwininet', '-liphlpapi', '-lnetapi32']
if have_qga_vss
qga_libs += ['-lole32', '-loleaut32', '-lshlwapi', '-lstdc++', '-Wl,--enable-stdcall-fixup']
subdir('vss-win32')
endif
if have_ntddscsi
qga_libs += ['-lsetupapi', '-lcfgmgr32']
endif
endif
qga = executable('qemu-ga', qga_ss.sources(), qga = executable('qemu-ga', qga_ss.sources(),
link_args: config_host['LIBS_QGA'].split(), link_args: qga_libs,
dependencies: [qemuutil, libudev], dependencies: [qemuutil, libudev],
install: true) install: true)
all_qga = [qga] all_qga += qga
if targetos == 'windows' if targetos == 'windows'
if 'CONFIG_QGA_VSS' in config_host
subdir('vss-win32')
else
gen_tlb = []
endif
qemu_ga_msi_arch = { qemu_ga_msi_arch = {
'x86': ['-D', 'Arch=32'], 'x86': ['-D', 'Arch=32'],
'x86_64': ['-a', 'x64', '-D', 'Arch=64'] 'x86_64': ['-a', 'x64', '-D', 'Arch=64']
@ -77,7 +114,7 @@ if targetos == 'windows'
if wixl.found() if wixl.found()
deps = [gen_tlb, qga] deps = [gen_tlb, qga]
qemu_ga_msi_vss = [] qemu_ga_msi_vss = []
if 'CONFIG_QGA_VSS' in config_host if have_qga_vss
qemu_ga_msi_vss = ['-D', 'InstallVss'] qemu_ga_msi_vss = ['-D', 'InstallVss']
deps += qga_vss deps += qga_vss
endif endif

View File

@ -13,7 +13,7 @@
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "vss-common.h" #include "vss-common.h"
#include <inc/win2003/vscoordint.h> #include <vscoordint.h>
#include "install.h" #include "install.h"
#include <wbemidl.h> #include <wbemidl.h>
#include <comdef.h> #include <comdef.h>

View File

@ -1,36 +1,38 @@
if add_languages('cpp', required: false) link_args = cc.get_supported_link_arguments([
glib_dynamic = dependency('glib-2.0', static: false) '-fstack-protector-all',
link_args = cc.get_supported_link_arguments(['-fstack-protector-all', '-fstack-protector-strong', '-fstack-protector-strong',
'-Wl,--add-stdcall-alias', '-Wl,--enable-stdcall-fixup']) '-Wl,--add-stdcall-alias',
'-Wl,--enable-stdcall-fixup'
])
qga_vss = shared_module('qga-vss', ['requester.cpp', 'provider.cpp', 'install.cpp'], qga_vss = shared_module(
name_prefix: '', 'qga-vss',
cpp_args: ['-Wno-unknown-pragmas', '-Wno-delete-non-virtual-dtor', '-Wno-non-virtual-dtor'], ['requester.cpp', 'provider.cpp', 'install.cpp'],
link_args: link_args, name_prefix: '',
vs_module_defs: 'qga-vss.def', cpp_args: ['-Wno-unknown-pragmas', '-Wno-delete-non-virtual-dtor', '-Wno-non-virtual-dtor'],
dependencies: [glib_dynamic, socket, link_args: link_args,
cc.find_library('ole32'), vs_module_defs: 'qga-vss.def',
cc.find_library('oleaut32'), dependencies: [
cc.find_library('shlwapi'), glib,
cc.find_library('uuid'), socket,
cc.find_library('intl')]) cc.find_library('ole32'),
cc.find_library('oleaut32'),
cc.find_library('shlwapi'),
cc.find_library('uuid'),
cc.find_library('intl')
]
)
all_qga += qga_vss all_qga += qga_vss
endif
# rules to build qga-vss.tlb
# Currently, only native build is supported because building .tlb
# (TypeLibrary) from .idl requires WindowsSDK and MIDL (and cl.exe in VC++).
midl = find_program('midl', required: false)
if midl.found() if midl.found()
gen_tlb = custom_target('gen-tlb', gen_tlb = custom_target('gen-tlb',
input: 'qga-vss.idl', input: 'qga-vss.idl',
output: 'qga-vss.tlb', output: 'qga-vss.tlb',
command: [midl, '-tlb', '-I' + config_host['WIN_SDK'], command: [midl, '@INPUT@', '/tlb', '@OUTPUT@'])
'@INPUT@', '@OUTPUT@'])
else else
gen_tlb = custom_target('gen-tlb', gen_tlb = custom_target('gen-tlb',
input: 'qga-vss.tlb', input: 'qga-vss.idl',
output: 'qga-vss.tlb', output: 'qga-vss.tlb',
command: ['cp', '@INPUT@', '@OUTPUT@']) command: [widl, '-t', '@INPUT@', '-o', '@OUTPUT@'])
endif endif

View File

@ -12,8 +12,8 @@
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "vss-common.h" #include "vss-common.h"
#include <inc/win2003/vscoordint.h> #include <vscoordint.h>
#include <inc/win2003/vsprov.h> #include <vsprov.h>
#define VSS_TIMEOUT_MSEC (60*1000) #define VSS_TIMEOUT_MSEC (60*1000)

Binary file not shown.

View File

@ -14,8 +14,8 @@
#include "vss-common.h" #include "vss-common.h"
#include "requester.h" #include "requester.h"
#include "install.h" #include "install.h"
#include <inc/win2003/vswriter.h> #include <vswriter.h>
#include <inc/win2003/vsbackup.h> #include <vsbackup.h>
/* Max wait time for frozen event (VSS can only hold writes for 10 seconds) */ /* Max wait time for frozen event (VSS can only hold writes for 10 seconds) */
#define VSS_TIMEOUT_FREEZE_MSEC 60000 #define VSS_TIMEOUT_FREEZE_MSEC 60000

View File

@ -46,11 +46,7 @@
#undef VSS_E_MAXIMUM_NUMBER_OF_VOLUMES_REACHED #undef VSS_E_MAXIMUM_NUMBER_OF_VOLUMES_REACHED
#undef VSS_E_MAXIMUM_NUMBER_OF_SNAPSHOTS_REACHED #undef VSS_E_MAXIMUM_NUMBER_OF_SNAPSHOTS_REACHED
/* #include <vss.h>
* VSS headers must be installed from Microsoft VSS SDK 7.2 available at:
* http://www.microsoft.com/en-us/download/details.aspx?id=23490
*/
#include <inc/win2003/vss.h>
#include "vss-handles.h" #include "vss-handles.h"
/* Macros to convert char definitions to wchar */ /* Macros to convert char definitions to wchar */

View File

@ -30,8 +30,10 @@ SKIP_OPTIONS = {
"default_devices", "default_devices",
"docdir", "docdir",
"fuzzing_engine", "fuzzing_engine",
"iasl",
"qemu_firmwarepath", "qemu_firmwarepath",
"qemu_suffix", "qemu_suffix",
"smbd",
"sphinx_build", "sphinx_build",
"trace_file", "trace_file",
} }

View File

@ -1,16 +1,29 @@
# This file is generated by meson-buildoptions.py, do not edit! # This file is generated by meson-buildoptions.py, do not edit!
meson_options_help() { meson_options_help() {
printf "%s\n" ' --enable-block-drv-whitelist-in-tools'
printf "%s\n" ' use block whitelist also in tools instead of only'
printf "%s\n" ' QEMU'
printf "%s\n" ' --enable-capstone[=CHOICE]' printf "%s\n" ' --enable-capstone[=CHOICE]'
printf "%s\n" ' Whether and how to find the capstone library' printf "%s\n" ' Whether and how to find the capstone library'
printf "%s\n" ' (choices: auto/disabled/enabled/internal/system)' printf "%s\n" ' (choices: auto/disabled/enabled/internal/system)'
printf "%s\n" ' --enable-cfi Control-Flow Integrity (CFI)' printf "%s\n" ' --enable-cfi Control-Flow Integrity (CFI)'
printf "%s\n" ' --enable-cfi-debug Verbose errors in case of CFI violation' printf "%s\n" ' --enable-cfi-debug Verbose errors in case of CFI violation'
printf "%s\n" ' --disable-coroutine-pool coroutine freelist (better performance)'
printf "%s\n" ' --enable-debug-mutex mutex debugging support'
printf "%s\n" ' --enable-debug-stack-usage'
printf "%s\n" ' measure coroutine stack usage'
printf "%s\n" ' --enable-fdt[=CHOICE] Whether and how to find the libfdt library' printf "%s\n" ' --enable-fdt[=CHOICE] Whether and how to find the libfdt library'
printf "%s\n" ' (choices: auto/disabled/enabled/internal/system)' printf "%s\n" ' (choices: auto/disabled/enabled/internal/system)'
printf "%s\n" ' --enable-fuzzing build fuzzing targets' printf "%s\n" ' --enable-fuzzing build fuzzing targets'
printf "%s\n" ' --enable-gprof QEMU profiling with gprof'
printf "%s\n" ' --disable-install-blobs install provided firmware blobs' printf "%s\n" ' --disable-install-blobs install provided firmware blobs'
printf "%s\n" ' --enable-malloc=CHOICE choose memory allocator to use [system] (choices:' printf "%s\n" ' --enable-malloc=CHOICE choose memory allocator to use [system] (choices:'
printf "%s\n" ' jemalloc/system/tcmalloc)' printf "%s\n" ' jemalloc/system/tcmalloc)'
printf "%s\n" ' --enable-profiler profiler support'
printf "%s\n" ' --enable-qga-vss build QGA VSS support'
printf "%s\n" ' --enable-qom-cast-debug cast debugging support'
printf "%s\n" ' --enable-rng-none dummy RNG, avoid using /dev/(u)random and'
printf "%s\n" ' getrandom()'
printf "%s\n" ' --enable-slirp[=CHOICE] Whether and how to find the slirp library' printf "%s\n" ' --enable-slirp[=CHOICE] Whether and how to find the slirp library'
printf "%s\n" ' (choices: auto/disabled/enabled/internal/system)' printf "%s\n" ' (choices: auto/disabled/enabled/internal/system)'
printf "%s\n" ' --enable-strip Strip targets on install' printf "%s\n" ' --enable-strip Strip targets on install'
@ -26,15 +39,21 @@ meson_options_help() {
printf "%s\n" ' alsa ALSA sound support' printf "%s\n" ' alsa ALSA sound support'
printf "%s\n" ' attr attr/xattr support' printf "%s\n" ' attr attr/xattr support'
printf "%s\n" ' auth-pam PAM access control' printf "%s\n" ' auth-pam PAM access control'
printf "%s\n" ' avx2 AVX2 optimizations'
printf "%s\n" ' avx512f AVX512F optimizations'
printf "%s\n" ' bochs bochs image format support'
printf "%s\n" ' bpf eBPF support' printf "%s\n" ' bpf eBPF support'
printf "%s\n" ' brlapi brlapi character device driver' printf "%s\n" ' brlapi brlapi character device driver'
printf "%s\n" ' bzip2 bzip2 support for DMG images' printf "%s\n" ' bzip2 bzip2 support for DMG images'
printf "%s\n" ' cap-ng cap_ng support' printf "%s\n" ' cap-ng cap_ng support'
printf "%s\n" ' cloop cloop image format support'
printf "%s\n" ' cocoa Cocoa user interface (macOS only)' printf "%s\n" ' cocoa Cocoa user interface (macOS only)'
printf "%s\n" ' coreaudio CoreAudio sound support' printf "%s\n" ' coreaudio CoreAudio sound support'
printf "%s\n" ' crypto-afalg Linux AF_ALG crypto backend driver'
printf "%s\n" ' curl CURL block device driver' printf "%s\n" ' curl CURL block device driver'
printf "%s\n" ' curses curses UI' printf "%s\n" ' curses curses UI'
printf "%s\n" ' dbus-display -display dbus support' printf "%s\n" ' dbus-display -display dbus support'
printf "%s\n" ' dmg dmg image format support'
printf "%s\n" ' docs Documentations build support' printf "%s\n" ' docs Documentations build support'
printf "%s\n" ' dsound DirectSound sound support' printf "%s\n" ' dsound DirectSound sound support'
printf "%s\n" ' fuse FUSE block device export' printf "%s\n" ' fuse FUSE block device export'
@ -44,6 +63,7 @@ meson_options_help() {
printf "%s\n" ' glusterfs Glusterfs block device driver' printf "%s\n" ' glusterfs Glusterfs block device driver'
printf "%s\n" ' gnutls GNUTLS cryptography support' printf "%s\n" ' gnutls GNUTLS cryptography support'
printf "%s\n" ' gtk GTK+ user interface' printf "%s\n" ' gtk GTK+ user interface'
printf "%s\n" ' guest-agent Build QEMU Guest Agent'
printf "%s\n" ' guest-agent-msi Build MSI package for the QEMU Guest Agent' printf "%s\n" ' guest-agent-msi Build MSI package for the QEMU Guest Agent'
printf "%s\n" ' hax HAX acceleration support' printf "%s\n" ' hax HAX acceleration support'
printf "%s\n" ' hvf HVF acceleration support' printf "%s\n" ' hvf HVF acceleration support'
@ -60,30 +80,42 @@ meson_options_help() {
printf "%s\n" ' libusb libusb support for USB passthrough' printf "%s\n" ' libusb libusb support for USB passthrough'
printf "%s\n" ' linux-aio Linux AIO support' printf "%s\n" ' linux-aio Linux AIO support'
printf "%s\n" ' linux-io-uring Linux io_uring support' printf "%s\n" ' linux-io-uring Linux io_uring support'
printf "%s\n" ' live-block-migration'
printf "%s\n" ' block migration in the main migration stream'
printf "%s\n" ' lzfse lzfse support for DMG images' printf "%s\n" ' lzfse lzfse support for DMG images'
printf "%s\n" ' lzo lzo compression support' printf "%s\n" ' lzo lzo compression support'
printf "%s\n" ' malloc-trim enable libc malloc_trim() for memory optimization' printf "%s\n" ' malloc-trim enable libc malloc_trim() for memory optimization'
printf "%s\n" ' membarrier membarrier system call (for Linux 4.14+ or Windows'
printf "%s\n" ' mpath Multipath persistent reservation passthrough' printf "%s\n" ' mpath Multipath persistent reservation passthrough'
printf "%s\n" ' multiprocess Out of process device emulation support' printf "%s\n" ' multiprocess Out of process device emulation support'
printf "%s\n" ' netmap netmap network backend support' printf "%s\n" ' netmap netmap network backend support'
printf "%s\n" ' nettle nettle cryptography support' printf "%s\n" ' nettle nettle cryptography support'
printf "%s\n" ' numa libnuma support'
printf "%s\n" ' nvmm NVMM acceleration support' printf "%s\n" ' nvmm NVMM acceleration support'
printf "%s\n" ' oss OSS sound support' printf "%s\n" ' oss OSS sound support'
printf "%s\n" ' pa PulseAudio sound support' printf "%s\n" ' pa PulseAudio sound support'
printf "%s\n" ' parallels parallels image format support'
printf "%s\n" ' qcow1 qcow1 image format support'
printf "%s\n" ' qed qed image format support'
printf "%s\n" ' rbd Ceph block device driver' printf "%s\n" ' rbd Ceph block device driver'
printf "%s\n" ' replication replication support'
printf "%s\n" ' sdl SDL user interface' printf "%s\n" ' sdl SDL user interface'
printf "%s\n" ' sdl-image SDL Image support for icons' printf "%s\n" ' sdl-image SDL Image support for icons'
printf "%s\n" ' seccomp seccomp support' printf "%s\n" ' seccomp seccomp support'
printf "%s\n" ' selinux SELinux support in qemu-nbd' printf "%s\n" ' selinux SELinux support in qemu-nbd'
printf "%s\n" ' slirp-smbd use smbd (at path --smbd=*) in slirp networking'
printf "%s\n" ' smartcard CA smartcard emulation support' printf "%s\n" ' smartcard CA smartcard emulation support'
printf "%s\n" ' snappy snappy compression support' printf "%s\n" ' snappy snappy compression support'
printf "%s\n" ' sparse sparse checker' printf "%s\n" ' sparse sparse checker'
printf "%s\n" ' spice Spice server support' printf "%s\n" ' spice Spice server support'
printf "%s\n" ' spice-protocol Spice protocol support' printf "%s\n" ' spice-protocol Spice protocol support'
printf "%s\n" ' tcg TCG support' printf "%s\n" ' tcg TCG support'
printf "%s\n" ' tools build support utilities that come with QEMU'
printf "%s\n" ' tpm TPM support'
printf "%s\n" ' u2f U2F emulation support' printf "%s\n" ' u2f U2F emulation support'
printf "%s\n" ' usb-redir libusbredir support' printf "%s\n" ' usb-redir libusbredir support'
printf "%s\n" ' vde vde network backend support' printf "%s\n" ' vde vde network backend support'
printf "%s\n" ' vdi vdi image format support'
printf "%s\n" ' vhost-user-blk-server' printf "%s\n" ' vhost-user-blk-server'
printf "%s\n" ' build vhost-user-blk server' printf "%s\n" ' build vhost-user-blk server'
printf "%s\n" ' virglrenderer virgl rendering support' printf "%s\n" ' virglrenderer virgl rendering support'
@ -94,6 +126,7 @@ meson_options_help() {
printf "%s\n" ' vnc-png PNG compression for VNC server' printf "%s\n" ' vnc-png PNG compression for VNC server'
printf "%s\n" ' vnc-sasl SASL authentication for VNC server' printf "%s\n" ' vnc-sasl SASL authentication for VNC server'
printf "%s\n" ' vte vte support for the gtk UI' printf "%s\n" ' vte vte support for the gtk UI'
printf "%s\n" ' vvfat vvfat image format support'
printf "%s\n" ' whpx WHPX acceleration support' printf "%s\n" ' whpx WHPX acceleration support'
printf "%s\n" ' xen Xen backend support' printf "%s\n" ' xen Xen backend support'
printf "%s\n" ' xen-pci-passthrough' printf "%s\n" ' xen-pci-passthrough'
@ -109,6 +142,14 @@ _meson_option_parse() {
--disable-attr) printf "%s" -Dattr=disabled ;; --disable-attr) printf "%s" -Dattr=disabled ;;
--enable-auth-pam) printf "%s" -Dauth_pam=enabled ;; --enable-auth-pam) printf "%s" -Dauth_pam=enabled ;;
--disable-auth-pam) printf "%s" -Dauth_pam=disabled ;; --disable-auth-pam) printf "%s" -Dauth_pam=disabled ;;
--enable-avx2) printf "%s" -Davx2=enabled ;;
--disable-avx2) printf "%s" -Davx2=disabled ;;
--enable-avx512f) printf "%s" -Davx512f=enabled ;;
--disable-avx512f) printf "%s" -Davx512f=disabled ;;
--enable-block-drv-whitelist-in-tools) printf "%s" -Dblock_drv_whitelist_in_tools=true ;;
--disable-block-drv-whitelist-in-tools) printf "%s" -Dblock_drv_whitelist_in_tools=false ;;
--enable-bochs) printf "%s" -Dbochs=enabled ;;
--disable-bochs) printf "%s" -Dbochs=disabled ;;
--enable-bpf) printf "%s" -Dbpf=enabled ;; --enable-bpf) printf "%s" -Dbpf=enabled ;;
--disable-bpf) printf "%s" -Dbpf=disabled ;; --disable-bpf) printf "%s" -Dbpf=disabled ;;
--enable-brlapi) printf "%s" -Dbrlapi=enabled ;; --enable-brlapi) printf "%s" -Dbrlapi=enabled ;;
@ -124,16 +165,28 @@ _meson_option_parse() {
--disable-cfi) printf "%s" -Dcfi=false ;; --disable-cfi) printf "%s" -Dcfi=false ;;
--enable-cfi-debug) printf "%s" -Dcfi_debug=true ;; --enable-cfi-debug) printf "%s" -Dcfi_debug=true ;;
--disable-cfi-debug) printf "%s" -Dcfi_debug=false ;; --disable-cfi-debug) printf "%s" -Dcfi_debug=false ;;
--enable-cloop) printf "%s" -Dcloop=enabled ;;
--disable-cloop) printf "%s" -Dcloop=disabled ;;
--enable-cocoa) printf "%s" -Dcocoa=enabled ;; --enable-cocoa) printf "%s" -Dcocoa=enabled ;;
--disable-cocoa) printf "%s" -Dcocoa=disabled ;; --disable-cocoa) printf "%s" -Dcocoa=disabled ;;
--enable-coreaudio) printf "%s" -Dcoreaudio=enabled ;; --enable-coreaudio) printf "%s" -Dcoreaudio=enabled ;;
--disable-coreaudio) printf "%s" -Dcoreaudio=disabled ;; --disable-coreaudio) printf "%s" -Dcoreaudio=disabled ;;
--enable-coroutine-pool) printf "%s" -Dcoroutine_pool=true ;;
--disable-coroutine-pool) printf "%s" -Dcoroutine_pool=false ;;
--enable-crypto-afalg) printf "%s" -Dcrypto_afalg=enabled ;;
--disable-crypto-afalg) printf "%s" -Dcrypto_afalg=disabled ;;
--enable-curl) printf "%s" -Dcurl=enabled ;; --enable-curl) printf "%s" -Dcurl=enabled ;;
--disable-curl) printf "%s" -Dcurl=disabled ;; --disable-curl) printf "%s" -Dcurl=disabled ;;
--enable-curses) printf "%s" -Dcurses=enabled ;; --enable-curses) printf "%s" -Dcurses=enabled ;;
--disable-curses) printf "%s" -Dcurses=disabled ;; --disable-curses) printf "%s" -Dcurses=disabled ;;
--enable-dbus-display) printf "%s" -Ddbus_display=enabled ;; --enable-dbus-display) printf "%s" -Ddbus_display=enabled ;;
--disable-dbus-display) printf "%s" -Ddbus_display=disabled ;; --disable-dbus-display) printf "%s" -Ddbus_display=disabled ;;
--enable-debug-mutex) printf "%s" -Ddebug_mutex=true ;;
--disable-debug-mutex) printf "%s" -Ddebug_mutex=false ;;
--enable-debug-stack-usage) printf "%s" -Ddebug_stack_usage=true ;;
--disable-debug-stack-usage) printf "%s" -Ddebug_stack_usage=false ;;
--enable-dmg) printf "%s" -Ddmg=enabled ;;
--disable-dmg) printf "%s" -Ddmg=disabled ;;
--enable-docs) printf "%s" -Ddocs=enabled ;; --enable-docs) printf "%s" -Ddocs=enabled ;;
--disable-docs) printf "%s" -Ddocs=disabled ;; --disable-docs) printf "%s" -Ddocs=disabled ;;
--enable-dsound) printf "%s" -Ddsound=enabled ;; --enable-dsound) printf "%s" -Ddsound=enabled ;;
@ -155,8 +208,12 @@ _meson_option_parse() {
--disable-glusterfs) printf "%s" -Dglusterfs=disabled ;; --disable-glusterfs) printf "%s" -Dglusterfs=disabled ;;
--enable-gnutls) printf "%s" -Dgnutls=enabled ;; --enable-gnutls) printf "%s" -Dgnutls=enabled ;;
--disable-gnutls) printf "%s" -Dgnutls=disabled ;; --disable-gnutls) printf "%s" -Dgnutls=disabled ;;
--enable-gprof) printf "%s" -Dgprof=true ;;
--disable-gprof) printf "%s" -Dgprof=false ;;
--enable-gtk) printf "%s" -Dgtk=enabled ;; --enable-gtk) printf "%s" -Dgtk=enabled ;;
--disable-gtk) printf "%s" -Dgtk=disabled ;; --disable-gtk) printf "%s" -Dgtk=disabled ;;
--enable-guest-agent) printf "%s" -Dguest_agent=enabled ;;
--disable-guest-agent) printf "%s" -Dguest_agent=disabled ;;
--enable-guest-agent-msi) printf "%s" -Dguest_agent_msi=enabled ;; --enable-guest-agent-msi) printf "%s" -Dguest_agent_msi=enabled ;;
--disable-guest-agent-msi) printf "%s" -Dguest_agent_msi=disabled ;; --disable-guest-agent-msi) printf "%s" -Dguest_agent_msi=disabled ;;
--enable-hax) printf "%s" -Dhax=enabled ;; --enable-hax) printf "%s" -Dhax=enabled ;;
@ -191,6 +248,8 @@ _meson_option_parse() {
--disable-linux-aio) printf "%s" -Dlinux_aio=disabled ;; --disable-linux-aio) printf "%s" -Dlinux_aio=disabled ;;
--enable-linux-io-uring) printf "%s" -Dlinux_io_uring=enabled ;; --enable-linux-io-uring) printf "%s" -Dlinux_io_uring=enabled ;;
--disable-linux-io-uring) printf "%s" -Dlinux_io_uring=disabled ;; --disable-linux-io-uring) printf "%s" -Dlinux_io_uring=disabled ;;
--enable-live-block-migration) printf "%s" -Dlive_block_migration=enabled ;;
--disable-live-block-migration) printf "%s" -Dlive_block_migration=disabled ;;
--enable-lzfse) printf "%s" -Dlzfse=enabled ;; --enable-lzfse) printf "%s" -Dlzfse=enabled ;;
--disable-lzfse) printf "%s" -Dlzfse=disabled ;; --disable-lzfse) printf "%s" -Dlzfse=disabled ;;
--enable-lzo) printf "%s" -Dlzo=enabled ;; --enable-lzo) printf "%s" -Dlzo=enabled ;;
@ -198,6 +257,8 @@ _meson_option_parse() {
--enable-malloc=*) quote_sh "-Dmalloc=$2" ;; --enable-malloc=*) quote_sh "-Dmalloc=$2" ;;
--enable-malloc-trim) printf "%s" -Dmalloc_trim=enabled ;; --enable-malloc-trim) printf "%s" -Dmalloc_trim=enabled ;;
--disable-malloc-trim) printf "%s" -Dmalloc_trim=disabled ;; --disable-malloc-trim) printf "%s" -Dmalloc_trim=disabled ;;
--enable-membarrier) printf "%s" -Dmembarrier=enabled ;;
--disable-membarrier) printf "%s" -Dmembarrier=disabled ;;
--enable-mpath) printf "%s" -Dmpath=enabled ;; --enable-mpath) printf "%s" -Dmpath=enabled ;;
--disable-mpath) printf "%s" -Dmpath=disabled ;; --disable-mpath) printf "%s" -Dmpath=disabled ;;
--enable-multiprocess) printf "%s" -Dmultiprocess=enabled ;; --enable-multiprocess) printf "%s" -Dmultiprocess=enabled ;;
@ -206,14 +267,32 @@ _meson_option_parse() {
--disable-netmap) printf "%s" -Dnetmap=disabled ;; --disable-netmap) printf "%s" -Dnetmap=disabled ;;
--enable-nettle) printf "%s" -Dnettle=enabled ;; --enable-nettle) printf "%s" -Dnettle=enabled ;;
--disable-nettle) printf "%s" -Dnettle=disabled ;; --disable-nettle) printf "%s" -Dnettle=disabled ;;
--enable-numa) printf "%s" -Dnuma=enabled ;;
--disable-numa) printf "%s" -Dnuma=disabled ;;
--enable-nvmm) printf "%s" -Dnvmm=enabled ;; --enable-nvmm) printf "%s" -Dnvmm=enabled ;;
--disable-nvmm) printf "%s" -Dnvmm=disabled ;; --disable-nvmm) printf "%s" -Dnvmm=disabled ;;
--enable-oss) printf "%s" -Doss=enabled ;; --enable-oss) printf "%s" -Doss=enabled ;;
--disable-oss) printf "%s" -Doss=disabled ;; --disable-oss) printf "%s" -Doss=disabled ;;
--enable-pa) printf "%s" -Dpa=enabled ;; --enable-pa) printf "%s" -Dpa=enabled ;;
--disable-pa) printf "%s" -Dpa=disabled ;; --disable-pa) printf "%s" -Dpa=disabled ;;
--enable-parallels) printf "%s" -Dparallels=enabled ;;
--disable-parallels) printf "%s" -Dparallels=disabled ;;
--enable-profiler) printf "%s" -Dprofiler=true ;;
--disable-profiler) printf "%s" -Dprofiler=false ;;
--enable-qcow1) printf "%s" -Dqcow1=enabled ;;
--disable-qcow1) printf "%s" -Dqcow1=disabled ;;
--enable-qed) printf "%s" -Dqed=enabled ;;
--disable-qed) printf "%s" -Dqed=disabled ;;
--enable-qga-vss) printf "%s" -Dqga_vss=enabled ;;
--disable-qga-vss) printf "%s" -Dqga_vss=disabled ;;
--enable-qom-cast-debug) printf "%s" -Dqom_cast_debug=true ;;
--disable-qom-cast-debug) printf "%s" -Dqom_cast_debug=false ;;
--enable-rbd) printf "%s" -Drbd=enabled ;; --enable-rbd) printf "%s" -Drbd=enabled ;;
--disable-rbd) printf "%s" -Drbd=disabled ;; --disable-rbd) printf "%s" -Drbd=disabled ;;
--enable-replication) printf "%s" -Dreplication=enabled ;;
--disable-replication) printf "%s" -Dreplication=disabled ;;
--enable-rng-none) printf "%s" -Drng_none=true ;;
--disable-rng-none) printf "%s" -Drng_none=false ;;
--enable-sdl) printf "%s" -Dsdl=enabled ;; --enable-sdl) printf "%s" -Dsdl=enabled ;;
--disable-sdl) printf "%s" -Dsdl=disabled ;; --disable-sdl) printf "%s" -Dsdl=disabled ;;
--enable-sdl-image) printf "%s" -Dsdl_image=enabled ;; --enable-sdl-image) printf "%s" -Dsdl_image=enabled ;;
@ -225,6 +304,8 @@ _meson_option_parse() {
--enable-slirp) printf "%s" -Dslirp=enabled ;; --enable-slirp) printf "%s" -Dslirp=enabled ;;
--disable-slirp) printf "%s" -Dslirp=disabled ;; --disable-slirp) printf "%s" -Dslirp=disabled ;;
--enable-slirp=*) quote_sh "-Dslirp=$2" ;; --enable-slirp=*) quote_sh "-Dslirp=$2" ;;
--enable-slirp-smbd) printf "%s" -Dslirp_smbd=enabled ;;
--disable-slirp-smbd) printf "%s" -Dslirp_smbd=disabled ;;
--enable-smartcard) printf "%s" -Dsmartcard=enabled ;; --enable-smartcard) printf "%s" -Dsmartcard=enabled ;;
--disable-smartcard) printf "%s" -Dsmartcard=disabled ;; --disable-smartcard) printf "%s" -Dsmartcard=disabled ;;
--enable-snappy) printf "%s" -Dsnappy=enabled ;; --enable-snappy) printf "%s" -Dsnappy=enabled ;;
@ -241,6 +322,10 @@ _meson_option_parse() {
--disable-tcg) printf "%s" -Dtcg=disabled ;; --disable-tcg) printf "%s" -Dtcg=disabled ;;
--enable-tcg-interpreter) printf "%s" -Dtcg_interpreter=true ;; --enable-tcg-interpreter) printf "%s" -Dtcg_interpreter=true ;;
--disable-tcg-interpreter) printf "%s" -Dtcg_interpreter=false ;; --disable-tcg-interpreter) printf "%s" -Dtcg_interpreter=false ;;
--enable-tools) printf "%s" -Dtools=enabled ;;
--disable-tools) printf "%s" -Dtools=disabled ;;
--enable-tpm) printf "%s" -Dtpm=enabled ;;
--disable-tpm) printf "%s" -Dtpm=disabled ;;
--enable-trace-backends=*) quote_sh "-Dtrace_backends=$2" ;; --enable-trace-backends=*) quote_sh "-Dtrace_backends=$2" ;;
--enable-u2f) printf "%s" -Du2f=enabled ;; --enable-u2f) printf "%s" -Du2f=enabled ;;
--disable-u2f) printf "%s" -Du2f=disabled ;; --disable-u2f) printf "%s" -Du2f=disabled ;;
@ -248,6 +333,8 @@ _meson_option_parse() {
--disable-usb-redir) printf "%s" -Dusb_redir=disabled ;; --disable-usb-redir) printf "%s" -Dusb_redir=disabled ;;
--enable-vde) printf "%s" -Dvde=enabled ;; --enable-vde) printf "%s" -Dvde=enabled ;;
--disable-vde) printf "%s" -Dvde=disabled ;; --disable-vde) printf "%s" -Dvde=disabled ;;
--enable-vdi) printf "%s" -Dvdi=enabled ;;
--disable-vdi) printf "%s" -Dvdi=disabled ;;
--enable-vhost-user-blk-server) printf "%s" -Dvhost_user_blk_server=enabled ;; --enable-vhost-user-blk-server) printf "%s" -Dvhost_user_blk_server=enabled ;;
--disable-vhost-user-blk-server) printf "%s" -Dvhost_user_blk_server=disabled ;; --disable-vhost-user-blk-server) printf "%s" -Dvhost_user_blk_server=disabled ;;
--enable-virglrenderer) printf "%s" -Dvirglrenderer=enabled ;; --enable-virglrenderer) printf "%s" -Dvirglrenderer=enabled ;;
@ -266,6 +353,8 @@ _meson_option_parse() {
--disable-vnc-sasl) printf "%s" -Dvnc_sasl=disabled ;; --disable-vnc-sasl) printf "%s" -Dvnc_sasl=disabled ;;
--enable-vte) printf "%s" -Dvte=enabled ;; --enable-vte) printf "%s" -Dvte=enabled ;;
--disable-vte) printf "%s" -Dvte=disabled ;; --disable-vte) printf "%s" -Dvte=disabled ;;
--enable-vvfat) printf "%s" -Dvvfat=enabled ;;
--disable-vvfat) printf "%s" -Dvvfat=disabled ;;
--enable-whpx) printf "%s" -Dwhpx=enabled ;; --enable-whpx) printf "%s" -Dwhpx=enabled ;;
--disable-whpx) printf "%s" -Dwhpx=disabled ;; --disable-whpx) printf "%s" -Dwhpx=disabled ;;
--enable-xen) printf "%s" -Dxen=enabled ;; --enable-xen) printf "%s" -Dxen=enabled ;;

View File

@ -2790,19 +2790,32 @@ void memory_global_after_dirty_log_sync(void)
MEMORY_LISTENER_CALL_GLOBAL(log_global_after_sync, Forward); MEMORY_LISTENER_CALL_GLOBAL(log_global_after_sync, Forward);
} }
/*
* Dirty track stop flags that are postponed due to VM being stopped. Should
* only be used within vmstate_change hook.
*/
static unsigned int postponed_stop_flags;
static VMChangeStateEntry *vmstate_change; static VMChangeStateEntry *vmstate_change;
static void memory_global_dirty_log_stop_postponed_run(void);
void memory_global_dirty_log_start(unsigned int flags) void memory_global_dirty_log_start(unsigned int flags)
{ {
unsigned int old_flags = global_dirty_tracking; unsigned int old_flags;
if (vmstate_change) {
qemu_del_vm_change_state_handler(vmstate_change);
vmstate_change = NULL;
}
assert(flags && !(flags & (~GLOBAL_DIRTY_MASK))); assert(flags && !(flags & (~GLOBAL_DIRTY_MASK)));
assert(!(global_dirty_tracking & flags));
if (vmstate_change) {
/* If there is postponed stop(), operate on it first */
postponed_stop_flags &= ~flags;
memory_global_dirty_log_stop_postponed_run();
}
flags &= ~global_dirty_tracking;
if (!flags) {
return;
}
old_flags = global_dirty_tracking;
global_dirty_tracking |= flags; global_dirty_tracking |= flags;
trace_global_dirty_changed(global_dirty_tracking); trace_global_dirty_changed(global_dirty_tracking);
@ -2830,29 +2843,45 @@ static void memory_global_dirty_log_do_stop(unsigned int flags)
} }
} }
/*
* Execute the postponed dirty log stop operations if there is, then reset
* everything (including the flags and the vmstate change hook).
*/
static void memory_global_dirty_log_stop_postponed_run(void)
{
/* This must be called with the vmstate handler registered */
assert(vmstate_change);
/* Note: postponed_stop_flags can be cleared in log start routine */
if (postponed_stop_flags) {
memory_global_dirty_log_do_stop(postponed_stop_flags);
postponed_stop_flags = 0;
}
qemu_del_vm_change_state_handler(vmstate_change);
vmstate_change = NULL;
}
static void memory_vm_change_state_handler(void *opaque, bool running, static void memory_vm_change_state_handler(void *opaque, bool running,
RunState state) RunState state)
{ {
unsigned int flags = (unsigned int)(uintptr_t)opaque;
if (running) { if (running) {
memory_global_dirty_log_do_stop(flags); memory_global_dirty_log_stop_postponed_run();
if (vmstate_change) {
qemu_del_vm_change_state_handler(vmstate_change);
vmstate_change = NULL;
}
} }
} }
void memory_global_dirty_log_stop(unsigned int flags) void memory_global_dirty_log_stop(unsigned int flags)
{ {
if (!runstate_is_running()) { if (!runstate_is_running()) {
/* Postpone the dirty log stop, e.g., to when VM starts again */
if (vmstate_change) { if (vmstate_change) {
return; /* Batch with previous postponed flags */
postponed_stop_flags |= flags;
} else {
postponed_stop_flags = flags;
vmstate_change = qemu_add_vm_change_state_handler(
memory_vm_change_state_handler, NULL);
} }
vmstate_change = qemu_add_vm_change_state_handler(
memory_vm_change_state_handler,
(void *)(uintptr_t)flags);
return; return;
} }

View File

@ -27,6 +27,9 @@ softmmu_ss.add(files(
'qdev-monitor.c', 'qdev-monitor.c',
), sdl, libpmem, libdaxctl) ), sdl, libpmem, libdaxctl)
softmmu_ss.add(when: 'CONFIG_TPM', if_true: files('tpm.c')) if have_tpm
softmmu_ss.add(files('tpm.c'))
endif
softmmu_ss.add(when: seccomp, if_true: files('qemu-seccomp.c')) softmmu_ss.add(when: seccomp, if_true: files('qemu-seccomp.c'))
softmmu_ss.add(when: fdt, if_true: files('device_tree.c')) softmmu_ss.add(when: fdt, if_true: files('device_tree.c'))

View File

@ -646,7 +646,7 @@ void x86_cpu_vendor_words2str(char *dst, uint32_t vendor1,
CPUID_7_0_EBX_HLE, CPUID_7_0_EBX_AVX2, CPUID_7_0_EBX_HLE, CPUID_7_0_EBX_AVX2,
CPUID_7_0_EBX_INVPCID, CPUID_7_0_EBX_RTM, CPUID_7_0_EBX_INVPCID, CPUID_7_0_EBX_RTM,
CPUID_7_0_EBX_RDSEED */ CPUID_7_0_EBX_RDSEED */
#define TCG_7_0_ECX_FEATURES (CPUID_7_0_ECX_PKU | \ #define TCG_7_0_ECX_FEATURES (CPUID_7_0_ECX_UMIP | CPUID_7_0_ECX_PKU | \
/* CPUID_7_0_ECX_OSPKE is dynamic */ \ /* CPUID_7_0_ECX_OSPKE is dynamic */ \
CPUID_7_0_ECX_LA57 | CPUID_7_0_ECX_PKS) CPUID_7_0_ECX_LA57 | CPUID_7_0_ECX_PKS)
#define TCG_7_0_EDX_FEATURES 0 #define TCG_7_0_EDX_FEATURES 0

View File

@ -167,6 +167,7 @@ typedef enum X86Seg {
#define HF_IOBPT_SHIFT 24 /* an io breakpoint enabled */ #define HF_IOBPT_SHIFT 24 /* an io breakpoint enabled */
#define HF_MPX_EN_SHIFT 25 /* MPX Enabled (CR4+XCR0+BNDCFGx) */ #define HF_MPX_EN_SHIFT 25 /* MPX Enabled (CR4+XCR0+BNDCFGx) */
#define HF_MPX_IU_SHIFT 26 /* BND registers in-use */ #define HF_MPX_IU_SHIFT 26 /* BND registers in-use */
#define HF_UMIP_SHIFT 27 /* CR4.UMIP */
#define HF_CPL_MASK (3 << HF_CPL_SHIFT) #define HF_CPL_MASK (3 << HF_CPL_SHIFT)
#define HF_INHIBIT_IRQ_MASK (1 << HF_INHIBIT_IRQ_SHIFT) #define HF_INHIBIT_IRQ_MASK (1 << HF_INHIBIT_IRQ_SHIFT)
@ -192,6 +193,7 @@ typedef enum X86Seg {
#define HF_IOBPT_MASK (1 << HF_IOBPT_SHIFT) #define HF_IOBPT_MASK (1 << HF_IOBPT_SHIFT)
#define HF_MPX_EN_MASK (1 << HF_MPX_EN_SHIFT) #define HF_MPX_EN_MASK (1 << HF_MPX_EN_SHIFT)
#define HF_MPX_IU_MASK (1 << HF_MPX_IU_SHIFT) #define HF_MPX_IU_MASK (1 << HF_MPX_IU_SHIFT)
#define HF_UMIP_MASK (1 << HF_UMIP_SHIFT)
/* hflags2 */ /* hflags2 */
@ -258,7 +260,7 @@ typedef enum X86Seg {
(~(target_ulong)(CR4_VME_MASK | CR4_PVI_MASK | CR4_TSD_MASK \ (~(target_ulong)(CR4_VME_MASK | CR4_PVI_MASK | CR4_TSD_MASK \
| CR4_DE_MASK | CR4_PSE_MASK | CR4_PAE_MASK \ | CR4_DE_MASK | CR4_PSE_MASK | CR4_PAE_MASK \
| CR4_MCE_MASK | CR4_PGE_MASK | CR4_PCE_MASK \ | CR4_MCE_MASK | CR4_PGE_MASK | CR4_PCE_MASK \
| CR4_OSFXSR_MASK | CR4_OSXMMEXCPT_MASK |CR4_UMIP_MASK \ | CR4_OSFXSR_MASK | CR4_OSXMMEXCPT_MASK | CR4_UMIP_MASK \
| CR4_LA57_MASK \ | CR4_LA57_MASK \
| CR4_FSGSBASE_MASK | CR4_PCIDE_MASK | CR4_OSXSAVE_MASK \ | CR4_FSGSBASE_MASK | CR4_PCIDE_MASK | CR4_OSXSAVE_MASK \
| CR4_SMEP_MASK | CR4_SMAP_MASK | CR4_PKE_MASK | CR4_PKS_MASK)) | CR4_SMEP_MASK | CR4_SMAP_MASK | CR4_PKE_MASK | CR4_PKS_MASK))

View File

@ -174,7 +174,7 @@ void cpu_x86_update_cr4(CPUX86State *env, uint32_t new_cr4)
} }
/* Clear bits we're going to recompute. */ /* Clear bits we're going to recompute. */
hflags = env->hflags & ~(HF_OSFXSR_MASK | HF_SMAP_MASK); hflags = env->hflags & ~(HF_OSFXSR_MASK | HF_SMAP_MASK | HF_UMIP_MASK);
/* SSE handling */ /* SSE handling */
if (!(env->features[FEAT_1_EDX] & CPUID_SSE)) { if (!(env->features[FEAT_1_EDX] & CPUID_SSE)) {
@ -190,6 +190,12 @@ void cpu_x86_update_cr4(CPUX86State *env, uint32_t new_cr4)
if (new_cr4 & CR4_SMAP_MASK) { if (new_cr4 & CR4_SMAP_MASK) {
hflags |= HF_SMAP_MASK; hflags |= HF_SMAP_MASK;
} }
if (!(env->features[FEAT_7_0_ECX] & CPUID_7_0_ECX_UMIP)) {
new_cr4 &= ~CR4_UMIP_MASK;
}
if (new_cr4 & CR4_UMIP_MASK) {
hflags |= HF_UMIP_MASK;
}
if (!(env->features[FEAT_7_0_ECX] & CPUID_7_0_ECX_PKU)) { if (!(env->features[FEAT_7_0_ECX] & CPUID_7_0_ECX_PKU)) {
new_cr4 &= ~CR4_PKE_MASK; new_cr4 &= ~CR4_PKE_MASK;

View File

@ -7382,6 +7382,9 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu)
case 0: /* sldt */ case 0: /* sldt */
if (!PE(s) || VM86(s)) if (!PE(s) || VM86(s))
goto illegal_op; goto illegal_op;
if (s->flags & HF_UMIP_MASK && !check_cpl0(s)) {
break;
}
gen_svm_check_intercept(s, SVM_EXIT_LDTR_READ); gen_svm_check_intercept(s, SVM_EXIT_LDTR_READ);
tcg_gen_ld32u_tl(s->T0, cpu_env, tcg_gen_ld32u_tl(s->T0, cpu_env,
offsetof(CPUX86State, ldt.selector)); offsetof(CPUX86State, ldt.selector));
@ -7401,6 +7404,9 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu)
case 1: /* str */ case 1: /* str */
if (!PE(s) || VM86(s)) if (!PE(s) || VM86(s))
goto illegal_op; goto illegal_op;
if (s->flags & HF_UMIP_MASK && !check_cpl0(s)) {
break;
}
gen_svm_check_intercept(s, SVM_EXIT_TR_READ); gen_svm_check_intercept(s, SVM_EXIT_TR_READ);
tcg_gen_ld32u_tl(s->T0, cpu_env, tcg_gen_ld32u_tl(s->T0, cpu_env,
offsetof(CPUX86State, tr.selector)); offsetof(CPUX86State, tr.selector));
@ -7439,6 +7445,9 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu)
modrm = x86_ldub_code(env, s); modrm = x86_ldub_code(env, s);
switch (modrm) { switch (modrm) {
CASE_MODRM_MEM_OP(0): /* sgdt */ CASE_MODRM_MEM_OP(0): /* sgdt */
if (s->flags & HF_UMIP_MASK && !check_cpl0(s)) {
break;
}
gen_svm_check_intercept(s, SVM_EXIT_GDTR_READ); gen_svm_check_intercept(s, SVM_EXIT_GDTR_READ);
gen_lea_modrm(env, s, modrm); gen_lea_modrm(env, s, modrm);
tcg_gen_ld32u_tl(s->T0, tcg_gen_ld32u_tl(s->T0,
@ -7495,6 +7504,9 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu)
break; break;
CASE_MODRM_MEM_OP(1): /* sidt */ CASE_MODRM_MEM_OP(1): /* sidt */
if (s->flags & HF_UMIP_MASK && !check_cpl0(s)) {
break;
}
gen_svm_check_intercept(s, SVM_EXIT_IDTR_READ); gen_svm_check_intercept(s, SVM_EXIT_IDTR_READ);
gen_lea_modrm(env, s, modrm); gen_lea_modrm(env, s, modrm);
tcg_gen_ld32u_tl(s->T0, cpu_env, offsetof(CPUX86State, idt.limit)); tcg_gen_ld32u_tl(s->T0, cpu_env, offsetof(CPUX86State, idt.limit));
@ -7670,6 +7682,9 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu)
break; break;
CASE_MODRM_OP(4): /* smsw */ CASE_MODRM_OP(4): /* smsw */
if (s->flags & HF_UMIP_MASK && !check_cpl0(s)) {
break;
}
gen_svm_check_intercept(s, SVM_EXIT_READ_CR0); gen_svm_check_intercept(s, SVM_EXIT_READ_CR0);
tcg_gen_ld_tl(s->T0, cpu_env, offsetof(CPUX86State, cr[0])); tcg_gen_ld_tl(s->T0, cpu_env, offsetof(CPUX86State, cr[0]));
/* /*

View File

@ -150,7 +150,7 @@ check-acceptance: check-acceptance-deprecated-warning | check-avocado
.PHONY: check-block check check-clean get-vm-images .PHONY: check-block check check-clean get-vm-images
check: check:
ifeq ($(CONFIG_TOOLS)$(CONFIG_POSIX),yy) ifneq ($(.check-block.deps),)
check: check-block check: check-block
check-block: run-ninja check-block: run-ninja
$(if $(MAKE.n),,+)$(MESON) test $(MTESTARGS) $(.mtestargs) --verbose \ $(if $(MAKE.n),,+)$(MESON) test $(MTESTARGS) $(.mtestargs) --verbose \

View File

@ -18,10 +18,6 @@ skip() {
exit 0 exit 0
} }
if grep -q "CONFIG_GPROF=y" config-host.mak 2>/dev/null ; then
skip "GPROF is enabled ==> Not running the qemu-iotests."
fi
# Disable tests with any sanitizer except for specific ones # Disable tests with any sanitizer except for specific ones
SANITIZE_FLAGS=$( grep "CFLAGS.*-fsanitize" config-host.mak 2>/dev/null ) SANITIZE_FLAGS=$( grep "CFLAGS.*-fsanitize" config-host.mak 2>/dev/null )
ALLOWED_SANITIZE_FLAGS="safe-stack cfi-icall" ALLOWED_SANITIZE_FLAGS="safe-stack cfi-icall"

View File

@ -85,7 +85,7 @@ if 'CONFIG_TCG' in config_all
subdir('fp') subdir('fp')
endif endif
if not get_option('tcg').disabled() if get_option('tcg').allowed()
if 'CONFIG_PLUGIN' in config_host if 'CONFIG_PLUGIN' in config_host
subdir('plugin') subdir('plugin')
endif endif

View File

@ -1,4 +1,4 @@
if have_tools and targetos != 'windows' if have_tools and targetos != 'windows' and not get_option('gprof')
qemu_iotests_binaries = [qemu_img, qemu_io, qemu_nbd, qsd] qemu_iotests_binaries = [qemu_img, qemu_io, qemu_nbd, qsd]
qemu_iotests_env = {'PYTHON': python.full_path()} qemu_iotests_env = {'PYTHON': python.full_path()}
qemu_iotests_formats = { qemu_iotests_formats = {

View File

@ -404,7 +404,10 @@ class TestRunner(ContextManager['TestRunner']):
if res.status == 'fail': if res.status == 'fail':
failed.append(name) failed.append(name)
if res.diff: if res.diff:
print('\n'.join(res.diff)) if self.tap:
print('\n'.join(res.diff), file=sys.stderr)
else:
print('\n'.join(res.diff))
elif res.status == 'not run': elif res.status == 'not run':
notrun.append(name) notrun.append(name)
elif res.status == 'pass': elif res.status == 'pass':

View File

@ -106,7 +106,7 @@ if have_block
if 'CONFIG_POSIX' in config_host if 'CONFIG_POSIX' in config_host
tests += {'test-image-locking': [testblock]} tests += {'test-image-locking': [testblock]}
endif endif
if 'CONFIG_REPLICATION' in config_host if config_host_data.get('CONFIG_REPLICATION')
tests += {'test-replication': [testblock]} tests += {'test-replication': [testblock]}
endif endif
if nettle.found() or gcrypt.found() if nettle.found() or gcrypt.found()
@ -149,9 +149,7 @@ if have_system
endif endif
endif endif
if 'CONFIG_TSAN' not in config_host and \ if have_ga and targetos == 'linux' and 'CONFIG_TSAN' not in config_host
'CONFIG_GUEST_AGENT' in config_host and \
'CONFIG_LINUX' in config_host
tests += {'test-qga': ['../qtest/libqtest.c']} tests += {'test-qga': ['../qtest/libqtest.c']}
test_deps += {'test-qga': qga} test_deps += {'test-qga': qga}
endif endif

View File

@ -1,25 +1,12 @@
have_virtiofsd = (targetos == 'linux' and have_virtiofsd = get_option('virtiofsd') \
have_tools and .require(targetos == 'linux',
seccomp.found() and error_message: 'virtiofsd requires Linux') \
libcap_ng.found() and .require(seccomp.found() and libcap_ng.found(),
'CONFIG_VHOST_USER' in config_host) error_message: 'virtiofsd requires libcap-ng-devel and seccomp-devel') \
.require('CONFIG_VHOST_USER' in config_host,
if get_option('virtiofsd').enabled() error_message: 'virtiofsd needs vhost-user-support') \
if not have_virtiofsd .disable_auto_if(not have_tools and not have_system) \
if targetos != 'linux' .allowed()
error('virtiofsd requires Linux')
elif not seccomp.found() or not libcap_ng.found()
error('virtiofsd requires libcap-ng-devel and seccomp-devel')
elif 'CONFIG_VHOST_USER' not in config_host
error('virtiofsd needs vhost-user support')
else
# Disabled all the tools but virtiofsd.
have_virtiofsd = true
endif
endif
elif get_option('virtiofsd').disabled() or not have_system
have_virtiofsd = false
endif
if have_virtiofsd if have_virtiofsd
subdir('virtiofsd') subdir('virtiofsd')

View File

@ -35,7 +35,9 @@ util_ss.add(files('crc32c.c'))
util_ss.add(files('uuid.c')) util_ss.add(files('uuid.c'))
util_ss.add(files('getauxval.c')) util_ss.add(files('getauxval.c'))
util_ss.add(files('rcu.c')) util_ss.add(files('rcu.c'))
util_ss.add(when: 'CONFIG_MEMBARRIER', if_true: files('sys_membarrier.c')) if have_membarrier
util_ss.add(files('sys_membarrier.c'))
endif
util_ss.add(files('log.c')) util_ss.add(files('log.c'))
util_ss.add(files('pagesize.c')) util_ss.add(files('pagesize.c'))
util_ss.add(files('qdist.c')) util_ss.add(files('qdist.c'))