configure, meson: move block layer options to meson_options.txt

Unlike image formats, these also require an entry in config-host.h.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2021-10-13 11:43:54 +02:00
parent ed793c2c45
commit 406523f6b3
7 changed files with 26 additions and 26 deletions

View File

@ -80,7 +80,9 @@ 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'))

20
configure vendored
View File

@ -329,8 +329,6 @@ coroutine=""
coroutine_pool="$default_feature" coroutine_pool="$default_feature"
debug_stack_usage="no" debug_stack_usage="no"
tls_priority="NORMAL" tls_priority="NORMAL"
live_block_migration=${default_feature:-yes}
replication=${default_feature:-yes}
debug_mutex="no" debug_mutex="no"
plugins="$default_feature" plugins="$default_feature"
rng_none="no" rng_none="no"
@ -1028,14 +1026,6 @@ for opt do
;; ;;
--disable-pvrdma) pvrdma="no" --disable-pvrdma) pvrdma="no"
;; ;;
--disable-live-block-migration) live_block_migration="no"
;;
--enable-live-block-migration) live_block_migration="yes"
;;
--disable-replication) replication="no"
;;
--enable-replication) replication="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"
@ -1329,9 +1319,7 @@ 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) coroutine-pool coroutine freelist (better performance)
replication replication support
opengl opengl support opengl opengl support
qom-cast-debug cast debugging support qom-cast-debug cast debugging support
tools build qemu-io, qemu-nbd and qemu-img tools tools build qemu-io, qemu-nbd and qemu-img tools
@ -3195,10 +3183,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 "$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
@ -3208,10 +3192,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 if test "$debug_mutex" = "yes" ; then
echo "CONFIG_DEBUG_MUTEX=y" >> $config_host_mak echo "CONFIG_DEBUG_MUTEX=y" >> $config_host_mak
fi fi

View File

@ -1539,6 +1539,9 @@ 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')
config_host_data.set('CONFIG_LIVE_BLOCK_MIGRATION', get_option('live_block_migration').allowed())
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'))
@ -2684,7 +2687,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')
@ -3461,8 +3466,8 @@ if have_block
summary_info += {'Use block whitelist in tools': config_host.has_key('CONFIG_BDRV_WHITELIST_TOOLS')} summary_info += {'Use block whitelist in tools': config_host.has_key('CONFIG_BDRV_WHITELIST_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': get_option('bochs').allowed()} summary_info += {'bochs support': get_option('bochs').allowed()}
summary_info += {'cloop support': get_option('cloop').allowed()} summary_info += {'cloop support': get_option('cloop').allowed()}
summary_info += {'dmg support': get_option('dmg').allowed()} summary_info += {'dmg support': get_option('dmg').allowed()}

View File

@ -222,6 +222,10 @@ 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', option('bochs', type: 'feature', value: 'auto',
description: 'bochs image format support') description: 'bochs image format support')
option('cloop', type: 'feature', value: 'auto', option('cloop', type: 'feature', value: 'auto',

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

@ -66,6 +66,8 @@ 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'
@ -82,6 +84,7 @@ meson_options_help() {
printf "%s\n" ' qcow1 qcow1 image format support' printf "%s\n" ' qcow1 qcow1 image format support'
printf "%s\n" ' qed qed 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'
@ -217,6 +220,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 ;;
@ -250,6 +255,8 @@ _meson_option_parse() {
--disable-qed) printf "%s" -Dqed=disabled ;; --disable-qed) printf "%s" -Dqed=disabled ;;
--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-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 ;;

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()