aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2022-04-20 17:33:53 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2022-05-07 07:46:58 +0200
commit622d64fffe4f287af4f0d5e438d4aa42da377811 (patch)
treee5edad5d6661e039f5fb0e8d68bfcb9abf5903ce /meson.build
parent41f2ae281953c7f7cfc28c5b93f9e0fb65cbd301 (diff)
meson, configure: move bdrv whitelists to meson
Use the new support for string option parsing. Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build27
1 files changed, 16 insertions, 11 deletions
diff --git a/meson.build b/meson.build
index ae3b3a45e7..3604a0d264 100644
--- a/meson.build
+++ b/meson.build
@@ -1594,6 +1594,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_RW_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
@@ -2209,16 +2222,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
@@ -3800,8 +3805,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}