Don't require libcap-ng for virtfs support
PATCH 1/1 Don't require libcap-ng for virtfs support
It's only required for the proxy helper.
--- meson.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
meson.build +3 -3
@@ -1759,12 +1759,12 @@ have_virtfs = get_option('virtfs') \ error_message: 'virtio-9p (virtfs) requires Linux or macOS') \ .require(targetos == 'linux' or cc.has_function('pthread_fchdir_np'), error_message: 'virtio-9p (virtfs) on macOS requires the presence of pthread_fchdir_np') \ - .require(targetos == 'darwin' or (libattr.found() and libcap_ng.found()), - error_message: 'virtio-9p (virtfs) on Linux requires libcap-ng-devel and libattr-devel') \ + .require(targetos == 'darwin' or libattr.found(), + error_message: 'virtio-9p (virtfs) on Linux requires libattr-devel') \ .disable_auto_if(not have_tools and not have_system) \ .allowed() -have_virtfs_proxy_helper = targetos != 'darwin' and have_virtfs and have_tools +have_virtfs_proxy_helper = targetos != 'darwin' and have_virtfs and have_tools and libcap_ng.found() if get_option('block_drv_ro_whitelist') == '' config_host_data.set('CONFIG_BDRV_RO_WHITELIST', '')
Signature · 1 line
2.40.0.634.g4ca3ef3211-goog
Quoted 14 lines · CEST Peter Foley
It's only required for the proxy helper.
Signed-off-by Peter Foley <[email protected]>--- meson.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)meson.build +0
-0@@ -1759,12 +1759,12 @@ have_virtfs = get_option('virtfs') \ error_message: 'virtio-9p (virtfs) requires Linux or macOS') \ .require(targetos == 'linux' or cc.has_function('pthread_fchdir_np'),
meson.build have_virtfs = get_option('virtfs') \ · line 1767
Quoted 10 lines
meson.build +3
-3error_message: 'virtio-9p (virtfs) on macOS requires the presence of pthread_fchdir_np') \ - .require(targetos == 'darwin' or (libattr.found() and libcap_ng.found()), - error_message: 'virtio-9p (virtfs) on Linux requires libcap-ng-devel and libattr-devel') \ + .require(targetos == 'darwin' or libattr.found(), + error_message: 'virtio-9p (virtfs) on Linux requires libattr-devel') \ .disable_auto_if(not have_tools and not have_system) \ .allowed() -have_virtfs_proxy_helper = targetos != 'darwin' and have_virtfs and have_tools +have_virtfs_proxy_helper = targetos != 'darwin' and have_virtfs and have_tools and libcap_ng.found()
Well, I don't know how many people actually use the 9p proxy, if at all, but don't you think there should be at least a warning or some kind of output e.g. in the configure summary that QEMU would build without 9p proxy support just because of a missing lib, instead of silently disabling it?
For macOS hosts we didn't care so far, because proxy is not implemented there and probably never will.
Quoted 4 lines
meson.build +0
-0if get_option('block_drv_ro_whitelist') == '' config_host_data.set('CONFIG_BDRV_RO_WHITELIST', '')
PATCH v2 1/1 Don't require libcap-ng for virtfs support
It's only required for the proxy helper.
Add a new option for the proxy helper rather than enabling it implicitly.
--- meson.build | 11 ++++++++--- meson_options.txt | 2 ++ scripts/meson-buildoptions.sh | 4 ++++ 3 files changed, 14 insertions(+), 3 deletions(-)
meson.build +8 -3
@@ -1759,12 +1759,17 @@ have_virtfs = get_option('virtfs') \ error_message: 'virtio-9p (virtfs) requires Linux or macOS') \ .require(targetos == 'linux' or cc.has_function('pthread_fchdir_np'), error_message: 'virtio-9p (virtfs) on macOS requires the presence of pthread_fchdir_np') \ - .require(targetos == 'darwin' or (libattr.found() and libcap_ng.found()), - error_message: 'virtio-9p (virtfs) on Linux requires libcap-ng-devel and libattr-devel') \ + .require(targetos == 'darwin' or libattr.found(), + error_message: 'virtio-9p (virtfs) on Linux requires libattr-devel') \ .disable_auto_if(not have_tools and not have_system) \ .allowed() -have_virtfs_proxy_helper = targetos != 'darwin' and have_virtfs and have_tools +have_virtfs_proxy_helper = get_option('virtfs_proxy_helper') \ + .require(targetos != 'darwin', error_message: 'the virtfs proxy helper is incompatible with macOS') \ + .require(have_virtfs, error_message: 'the virtfs proxy helper requires that virtfs is enabled') \ + .disable_auto_if(not have_tools) \ + .require(libcap_ng.found(), error_message: 'the virtfs proxy helper requires libcap-ng') \ + .allowed() if get_option('block_drv_ro_whitelist') == '' config_host_data.set('CONFIG_BDRV_RO_WHITELIST', '')
meson_options.txt +2 -0
@@ -272,6 +272,8 @@ option('vhost_user_blk_server', type: 'feature', value: 'auto', description: 'build vhost-user-blk server') option('virtfs', type: 'feature', value: 'auto', description: 'virtio-9p support') +option('virtfs_proxy_helper', type: 'feature', value: 'auto', + description: 'virtio-9p proxy helper support') option('libvduse', type: 'feature', value: 'auto', description: 'build VDUSE Library') option('vduse_blk_export', type: 'feature', value: 'auto',
scripts/meson-buildoptions.sh +4 -0
@@ -176,6 +176,8 @@ meson_options_help() { printf "%s\n" ' vhost-vdpa vhost-vdpa kernel backend support' printf "%s\n" ' virglrenderer virgl rendering support' printf "%s\n" ' virtfs virtio-9p support' + printf "%s\n" ' virtfs-proxy-helper' + printf "%s\n" ' virtio-9p proxy helper support' printf "%s\n" ' vmnet vmnet.framework network backend support' printf "%s\n" ' vnc VNC server' printf "%s\n" ' vnc-jpeg JPEG lossy compression for VNC server'
@@ -461,6 +463,8 @@ _meson_option_parse() { --disable-virglrenderer) printf "%s" -Dvirglrenderer=disabled ;; --enable-virtfs) printf "%s" -Dvirtfs=enabled ;; --disable-virtfs) printf "%s" -Dvirtfs=disabled ;; + --enable-virtfs-proxy-helper) printf "%s" -Dvirtfs_proxy_helper=enabled ;; + --disable-virtfs-proxy-helper) printf "%s" -Dvirtfs_proxy_helper=disabled ;; --enable-vmnet) printf "%s" -Dvmnet=enabled ;; --disable-vmnet) printf "%s" -Dvmnet=disabled ;; --enable-vnc) printf "%s" -Dvnc=enabled ;;
Signature · 1 line
2.40.1.495.gc816e09b53d-goog