From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [PATCH 20/34] meson, configure: move bdrv whitelists to meson
Date: Wed, 20 Apr 2022 17:33:53 +0200 [thread overview]
Message-ID: <20220420153407.73926-21-pbonzini@redhat.com> (raw)
In-Reply-To: <20220420153407.73926-1-pbonzini@redhat.com>
Use the new support for string option parsing.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
configure | 14 --------------
meson.build | 27 ++++++++++++++++-----------
meson_options.txt | 4 ++++
scripts/meson-buildoptions.sh | 8 ++++++++
4 files changed, 28 insertions(+), 25 deletions(-)
diff --git a/configure b/configure
index 3327a4887a..bc15854578 100755
--- a/configure
+++ b/configure
@@ -235,8 +235,6 @@ interp_prefix="/usr/gnemul/qemu-%M"
static="no"
cross_compile="no"
cross_prefix=""
-block_drv_rw_whitelist=""
-block_drv_ro_whitelist=""
host_cc="cc"
lto="false"
stack_protector=""
@@ -815,10 +813,6 @@ for opt do
# configure to be used by RPM and similar macros that set
# lots of directory switches by default.
;;
- --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')
- ;;
--enable-debug-tcg) debug_tcg="yes"
;;
--disable-debug-tcg) debug_tcg="no"
@@ -1154,12 +1148,6 @@ Advanced options (experts only):
--disable-stack-protector disable compiler-provided stack protection
--audio-drv-list=LIST set audio drivers to try if -audiodev is not used
--block-drv-whitelist=L Same as --block-drv-rw-whitelist=L
- --block-drv-rw-whitelist=L
- set block driver read-write whitelist
- (by default affects only QEMU, not tools like qemu-img)
- --block-drv-ro-whitelist=L
- set block driver read-only whitelist
- (by default affects only QEMU, not tools like qemu-img)
--with-trace-file=NAME Full PATH,NAME of file to store traces
Default:trace-<pid>
--cpu=CPU Build for host CPU [$cpu]
@@ -2184,8 +2172,6 @@ fi
if test "$static" = "yes" ; then
echo "CONFIG_STATIC=y" >> $config_host_mak
fi
-echo "CONFIG_BDRV_RW_WHITELIST=$block_drv_rw_whitelist" >> $config_host_mak
-echo "CONFIG_BDRV_RO_WHITELIST=$block_drv_ro_whitelist" >> $config_host_mak
qemu_version=$(head $source_path/VERSION)
echo "PKGVERSION=$pkgversion" >>$config_host_mak
echo "SRC_PATH=$source_path" >> $config_host_mak
diff --git a/meson.build b/meson.build
index 8a7e4ab5c7..ee96cbc64e 100644
--- a/meson.build
+++ b/meson.build
@@ -1592,6 +1592,19 @@ have_virtfs = get_option('virtfs') \
have_virtfs_proxy_helper = targetos != 'darwin' and have_virtfs and have_tools
+if get_option('block_drv_ro_whitelist') == ''
+ config_host_data.set('CONFIG_BDRV_RO_WHITELIST', '')
+else
+ config_host_data.set('CONFIG_BDRV_RO_WHITELIST',
+ '"' + get_option('block_drv_ro_whitelist').replace(',', '", "') + '"')
+endif
+if get_option('block_drv_rw_whitelist') == ''
+ config_host_data.set('CONFIG_BDRV_RW_WHITELIST', '')
+else
+ config_host_data.set('CONFIG_BDRV_RO_WHITELIST',
+ '"' + get_option('block_drv_rw_whitelist').replace(',', '", "') + '"')
+endif
+
foreach k : get_option('trace_backends')
config_host_data.set('CONFIG_TRACE_' + k.to_upper(), true)
endforeach
@@ -2207,16 +2220,8 @@ config_host_data.set('HAVE_VSS_SDK', have_vss_sdk)
ignored = ['CONFIG_QEMU_INTERP_PREFIX', # actually per-target
'HAVE_GDB_BIN']
-arrays = ['CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST']
foreach k, v: config_host
- if ignored.contains(k)
- # do nothing
- elif arrays.contains(k)
- if v != ''
- v = '"' + '", "'.join(v.split()) + '", '
- endif
- config_host_data.set(k, v)
- elif k.startswith('CONFIG_')
+ if k.startswith('CONFIG_') and not ignored.contains(k)
config_host_data.set(k, v == 'y' ? 1 : v)
endif
endforeach
@@ -3786,8 +3791,8 @@ summary_info = {}
summary_info += {'coroutine backend': config_host['CONFIG_COROUTINE_BACKEND']}
summary_info += {'coroutine pool': have_coroutine_pool}
if have_block
- 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 (rw)': get_option('block_drv_rw_whitelist')}
+ summary_info += {'Block whitelist (ro)': get_option('block_drv_ro_whitelist')}
summary_info += {'Use block whitelist in tools': get_option('block_drv_whitelist_in_tools')}
summary_info += {'VirtFS support': have_virtfs}
summary_info += {'build virtiofs daemon': have_virtiofsd}
diff --git a/meson_options.txt b/meson_options.txt
index 891c0ec130..ec974003b3 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -21,6 +21,10 @@ option('default_devices', type : 'boolean', value : true,
option('audio_drv_list', type: 'array', value: ['default'],
choices: ['alsa', 'coreaudio', 'default', 'dsound', 'jack', 'oss', 'pa', 'sdl'],
description: 'Set audio driver list')
+option('block_drv_rw_whitelist', type : 'string', value : '',
+ description: 'set block driver read-write whitelist (by default affects only QEMU, not tools like qemu-img)')
+option('block_drv_ro_whitelist', type : 'string', value : '',
+ description: 'set block driver read-only whitelist (by default affects only QEMU, not tools like qemu-img)')
option('fuzzing_engine', type : 'string', value : '',
description: 'fuzzing engine library for OSS-Fuzz')
option('trace_file', type: 'string', value: 'trace',
diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
index 0e0548aa87..4c49d4af08 100644
--- a/scripts/meson-buildoptions.sh
+++ b/scripts/meson-buildoptions.sh
@@ -2,6 +2,12 @@
meson_options_help() {
printf "%s\n" ' --audio-drv-list=CHOICES Set audio driver list [default] (choices:'
printf "%s\n" ' alsa/coreaudio/default/dsound/jack/oss/pa/sdl)'
+ printf "%s\n" ' --block-drv-ro-whitelist=VALUE'
+ printf "%s\n" ' set block driver read-only whitelist (by default'
+ printf "%s\n" ' affects only QEMU, not tools like qemu-img)'
+ printf "%s\n" ' --block-drv-rw-whitelist=VALUE'
+ printf "%s\n" ' set block driver read-write whitelist (by default'
+ printf "%s\n" ' affects only QEMU, not tools like qemu-img)'
printf "%s\n" ' --disable-coroutine-pool coroutine freelist (better performance)'
printf "%s\n" ' --disable-install-blobs install provided firmware blobs'
printf "%s\n" ' --enable-block-drv-whitelist-in-tools'
@@ -161,6 +167,8 @@ _meson_option_parse() {
--disable-avx2) printf "%s" -Davx2=disabled ;;
--enable-avx512f) printf "%s" -Davx512f=enabled ;;
--disable-avx512f) printf "%s" -Davx512f=disabled ;;
+ --block-drv-ro-whitelist=*) quote_sh "-Dblock_drv_ro_whitelist=$2" ;;
+ --block-drv-rw-whitelist=*) quote_sh "-Dblock_drv_rw_whitelist=$2" ;;
--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 ;;
--
2.35.1
next prev parent reply other threads:[~2022-04-20 15:58 UTC|newest]
Thread overview: 74+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-20 15:33 [PATCH 00/34] Misc meson conversions for QEMU 7.1 Paolo Bonzini
2022-04-20 15:33 ` [PATCH 01/34] meson: show final set of compiler flags Paolo Bonzini
2022-04-20 15:57 ` Marc-André Lureau
2022-04-20 15:33 ` [PATCH 02/34] configure: remove dead code Paolo Bonzini
2022-04-20 16:04 ` Marc-André Lureau
2022-04-20 15:33 ` [PATCH 03/34] qga: wixl: get path to sysroot from pkg-config as intended Paolo Bonzini
2022-04-20 15:47 ` Marc-André Lureau
2022-04-21 14:18 ` Konstantin Kostiuk
2022-04-20 15:33 ` [PATCH 04/34] configure: pc-bios/qemu-icon.bmp does not exist Paolo Bonzini
2022-04-20 15:47 ` Thomas Huth
2022-04-20 16:05 ` Marc-André Lureau
2022-04-20 15:33 ` [PATCH 05/34] configure: gcov should not exclude fortify-source Paolo Bonzini
2022-04-20 16:06 ` Marc-André Lureau
2022-04-20 15:33 ` [PATCH 06/34] configure: move --enable/--disable-debug-info to second option parsing pass Paolo Bonzini
2022-04-20 15:42 ` Thomas Huth
2022-04-20 16:08 ` Marc-André Lureau
2022-04-20 15:33 ` [PATCH 07/34] configure, meson: move OpenGL check to meson Paolo Bonzini
2022-04-20 16:13 ` Marc-André Lureau
2022-04-20 19:17 ` Paolo Bonzini
2022-04-20 15:33 ` [PATCH 08/34] meson, configure: move RDMA options " Paolo Bonzini
2022-04-20 16:24 ` Marc-André Lureau
2022-04-20 15:33 ` [PATCH 09/34] meson, configure: move keyctl test " Paolo Bonzini
2022-04-20 16:27 ` Marc-André Lureau
2022-04-20 15:33 ` [PATCH 10/34] meson, configure: move usbfs " Paolo Bonzini
2022-04-20 16:35 ` Marc-André Lureau
2022-04-20 15:33 ` [PATCH 11/34] meson, configure: move libgio " Paolo Bonzini
2022-04-20 16:40 ` Marc-André Lureau
2022-04-20 15:33 ` [PATCH 12/34] meson: move CONFIG_XEN_PCI_PASSTHROUGH to config-host.h Paolo Bonzini
2022-04-20 16:45 ` Marc-André Lureau
2022-04-20 15:33 ` [PATCH 13/34] meson, configure: move --enable-module-upgrades to meson Paolo Bonzini
2022-04-20 18:05 ` Marc-André Lureau
2022-04-20 15:33 ` [PATCH 14/34] meson, configure: move Xen detection " Paolo Bonzini
2022-04-20 15:33 ` [PATCH 15/34] meson-buildoptions: add support for string options Paolo Bonzini
2022-04-20 18:14 ` Marc-André Lureau
2022-04-20 15:33 ` [PATCH 16/34] configure, meson: move iasl detection to meson Paolo Bonzini
2022-04-20 18:17 ` Marc-André Lureau
2022-04-20 15:33 ` [PATCH 17/34] configure: move Windows flags " Paolo Bonzini
2022-04-20 18:20 ` Marc-André Lureau
2022-04-20 19:15 ` Paolo Bonzini
2022-04-20 15:33 ` [PATCH 18/34] configure: switch string options to automatic parsing Paolo Bonzini
2022-04-20 18:23 ` Marc-André Lureau
2022-04-20 15:33 ` [PATCH 19/34] meson, configure: move --tls-priority to meson Paolo Bonzini
2022-04-20 18:25 ` Marc-André Lureau
2022-04-20 15:33 ` Paolo Bonzini [this message]
2022-04-20 18:28 ` [PATCH 20/34] meson, configure: move bdrv whitelists " Marc-André Lureau
2022-04-20 15:33 ` [PATCH 21/34] meson, configure: move --with-pkgversion, CONFIG_STAMP " Paolo Bonzini
2022-04-20 18:34 ` Marc-André Lureau
2022-04-20 15:33 ` [PATCH 22/34] meson, configure: move --interp-prefix " Paolo Bonzini
2022-04-20 18:40 ` Marc-André Lureau
2022-04-20 15:33 ` [PATCH 23/34] meson: always combine directories with prefix Paolo Bonzini
2022-04-20 18:43 ` Marc-André Lureau
2022-04-20 15:33 ` [PATCH 24/34] configure: switch directory options to automatic parsing Paolo Bonzini
2022-04-21 9:48 ` Marc-André Lureau
2022-04-21 12:02 ` Paolo Bonzini
2022-04-20 15:33 ` [PATCH 25/34] meson: pass more options directly as -D Paolo Bonzini
2022-04-21 9:52 ` Marc-André Lureau
2022-04-20 15:33 ` [PATCH 26/34] configure: omit options with default values from meson command line Paolo Bonzini
2022-04-21 10:04 ` Marc-André Lureau
2022-04-20 15:34 ` [PATCH 27/34] meson, virtio: place all virtio-pci devices under virtio_pci_ss Paolo Bonzini
2022-04-21 10:05 ` Marc-André Lureau
2022-04-20 15:34 ` [PATCH 28/34] configure: simplify vhost-net-{user, vdpa} configuration Paolo Bonzini
2022-04-21 10:08 ` Marc-André Lureau
2022-04-20 15:34 ` [PATCH 29/34] build: move vhost-vsock configuration to Kconfig Paolo Bonzini
2022-04-21 11:38 ` Marc-André Lureau
2022-04-20 15:34 ` [PATCH 30/34] build: move vhost-scsi " Paolo Bonzini
2022-04-21 11:47 ` Marc-André Lureau
2022-04-20 15:34 ` [PATCH 31/34] build: move vhost-user-fs " Paolo Bonzini
2022-04-21 11:48 ` Marc-André Lureau
2022-04-20 15:34 ` [PATCH 32/34] meson: create have_vhost_* variables Paolo Bonzini
2022-04-21 12:01 ` Marc-André Lureau
2022-04-20 15:34 ` [PATCH 33/34] meson: use have_vhost_* variables to pick sources Paolo Bonzini
2022-04-21 12:08 ` Marc-André Lureau
2022-04-20 15:34 ` [PATCH 34/34] configure, meson: move vhost options to Meson Paolo Bonzini
2022-04-21 12:13 ` Marc-André Lureau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220420153407.73926-21-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).