[PATCH] meson: do not look for libdevmapper/libparted if not requested

Paolo Bonzini posted 1 patch 2 years, 7 months ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20220324105304.142101-2-pbonzini@redhat.com
meson.build | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH] meson: do not look for libdevmapper/libparted if not requested
Posted by Paolo Bonzini 2 years, 7 months ago
devmapper_dep and libparted_dep are not used if -Dstorage_disk=disabled.  Do
not bother looking for these libraries if the disk storage backend was not
requested.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 meson.build | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index eb13c7efa4..9d1f90fc80 100644
--- a/meson.build
+++ b/meson.build
@@ -933,7 +933,7 @@ if curl_dep.found()
 endif
 
 devmapper_version = '1.0.0'
-devmapper_dep = dependency('devmapper', version: '>=' + devmapper_version, required: false)
+devmapper_dep = dependency('devmapper', version: '>=' + devmapper_version, required: get_option('storage_disk'))
 if devmapper_dep.found()
   conf.set('WITH_DEVMAPPER', 1)
 endif
@@ -1013,7 +1013,7 @@ else
 endif
 
 libparted_version = '1.8.0'
-libparted_dep = dependency('libparted', version: '>=' + libparted_version, required: false)
+libparted_dep = dependency('libparted', version: '>=' + libparted_version, required: get_option('storage_disk'))
 
 libpcap_version = '1.5.0'
 if not get_option('libpcap').disabled()
-- 
2.35.1
Re: [PATCH] meson: do not look for libdevmapper/libparted if not requested
Posted by Michal Prívozník 2 years, 7 months ago
On 3/24/22 11:53, Paolo Bonzini wrote:
> devmapper_dep and libparted_dep are not used if -Dstorage_disk=disabled.  Do
> not bother looking for these libraries if the disk storage backend was not
> requested.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  meson.build | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index eb13c7efa4..9d1f90fc80 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -933,7 +933,7 @@ if curl_dep.found()
>  endif
>  
>  devmapper_version = '1.0.0'
> -devmapper_dep = dependency('devmapper', version: '>=' + devmapper_version, required: false)
> +devmapper_dep = dependency('devmapper', version: '>=' + devmapper_version, required: get_option('storage_disk'))
>  if devmapper_dep.found()
>    conf.set('WITH_DEVMAPPER', 1)
>  endif


Not true. src/util/virdevmapper.c uses libdevmapper so that we can query
and set up all dependent devices in namespaces (virDevMapperGetTargets()).

> @@ -1013,7 +1013,7 @@ else
>  endif
>  
>  libparted_version = '1.8.0'
> -libparted_dep = dependency('libparted', version: '>=' + libparted_version, required: false)
> +libparted_dep = dependency('libparted', version: '>=' + libparted_version, required: get_option('storage_disk'))
>  
>  libpcap_version = '1.5.0'
>  if not get_option('libpcap').disabled()

ACK to this hunk though.

Michal