[PATCH-for-5.2 v2 2/4] meson: Only build vhost-user when system or tools is enabled

Philippe Mathieu-Daudé posted 4 patches 5 years ago
[PATCH-for-5.2 v2 2/4] meson: Only build vhost-user when system or tools is enabled
Posted by Philippe Mathieu-Daudé 5 years ago
It does not make sense to select vhost-user features
without system-mode or tools. Return an error when
this configuration is selected. Example:

  $ ../configure --disable-tools --disable-system --enable-vhost-user-blk-server

  ../meson.build:755:4: ERROR: Problem encountered: vhost-user does not make sense without system or tools support enabled

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 meson.build | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/meson.build b/meson.build
index 4b789f18c17..4fc58eb2c3d 100644
--- a/meson.build
+++ b/meson.build
@@ -751,6 +751,10 @@
 
 has_statx = cc.links(statx_test)
 
+if 'CONFIG_VHOST_USER' in config_host and not (have_system or have_tools)
+    error('vhost-user does not make sense without system or tools support enabled')
+endif
+
 have_vhost_user_blk_server = (targetos == 'linux')
 
 if get_option('vhost_user_blk_server').enabled()
-- 
2.26.2

Re: [PATCH-for-5.2 v2 2/4] meson: Only build vhost-user when system or tools is enabled
Posted by Stefan Hajnoczi 5 years ago
On Wed, Nov 11, 2020 at 01:09:10PM +0100, Philippe Mathieu-Daudé wrote:
> It does not make sense to select vhost-user features
> without system-mode or tools. Return an error when
> this configuration is selected. Example:
> 
>   $ ../configure --disable-tools --disable-system --enable-vhost-user-blk-server
> 
>   ../meson.build:755:4: ERROR: Problem encountered: vhost-user does not make sense without system or tools support enabled
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  meson.build | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/meson.build b/meson.build
> index 4b789f18c17..4fc58eb2c3d 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -751,6 +751,10 @@
>  
>  has_statx = cc.links(statx_test)
>  
> +if 'CONFIG_VHOST_USER' in config_host and not (have_system or have_tools)
> +    error('vhost-user does not make sense without system or tools support enabled')
> +endif

Now the following fails on Linux hosts:

  $ ./configure --disable-tools --disable-system
  ../meson.build:755:4: ERROR: Problem encountered: vhost-user does not make sense without system or tools support enabled

Previously it would succeed and make would build qemu-user binaries,
documentation, trace-events-all, etc so this looks like a regression.

In addition, adding this error is inconsistent with all the other
./configure options which do not check whether the build target that
uses them has been disabled. We'd need to implement the same check for
every option to make ./configure consistent. For example, if SPICE is
enabled but --disable-system is given then there should be an error
saying it enabling SPICE does not make sense, etc.

Stefan
Re: [PATCH-for-5.2 v2 2/4] meson: Only build vhost-user when system or tools is enabled
Posted by Philippe Mathieu-Daudé 5 years ago
On 11/11/20 4:48 PM, Stefan Hajnoczi wrote:
> On Wed, Nov 11, 2020 at 01:09:10PM +0100, Philippe Mathieu-Daudé wrote:
>> It does not make sense to select vhost-user features
>> without system-mode or tools. Return an error when
>> this configuration is selected. Example:
>>
>>   $ ../configure --disable-tools --disable-system --enable-vhost-user-blk-server
>>
>>   ../meson.build:755:4: ERROR: Problem encountered: vhost-user does not make sense without system or tools support enabled
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> ---
>>  meson.build | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/meson.build b/meson.build
>> index 4b789f18c17..4fc58eb2c3d 100644
>> --- a/meson.build
>> +++ b/meson.build
>> @@ -751,6 +751,10 @@
>>  
>>  has_statx = cc.links(statx_test)
>>  
>> +if 'CONFIG_VHOST_USER' in config_host and not (have_system or have_tools)
>> +    error('vhost-user does not make sense without system or tools support enabled')
>> +endif
> 
> Now the following fails on Linux hosts:
> 
>   $ ./configure --disable-tools --disable-system
>   ../meson.build:755:4: ERROR: Problem encountered: vhost-user does not make sense without system or tools support enabled
> 
> Previously it would succeed and make would build qemu-user binaries,
> documentation, trace-events-all, etc so this looks like a regression.
> 
> In addition, adding this error is inconsistent with all the other
> ./configure options which do not check whether the build target that
> uses them has been disabled. We'd need to implement the same check for
> every option to make ./configure consistent. For example, if SPICE is
> enabled but --disable-system is given then there should be an error
> saying it enabling SPICE does not make sense, etc.

OK. Back to your v1 then =)

> 
> Stefan
>