[PATCH 3/3] configure: Emit warning when accelerator requested but not needed

Philippe Mathieu-Daudé posted 3 patches 4 years, 10 months ago
There is a newer version of this series
[PATCH 3/3] configure: Emit warning when accelerator requested but not needed
Posted by Philippe Mathieu-Daudé 4 years, 10 months ago
In some configurations it might be pointless to check and
compile accelerator code. Do not deselect the accelerator,
but emit a warning.

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

diff --git a/configure b/configure
index a5159157a49..09e1cd8bfe6 100755
--- a/configure
+++ b/configure
@@ -5514,6 +5514,27 @@ if test $git_update = 'yes' ; then
     (cd "${source_path}" && GIT="$git" "./scripts/git-submodule.sh" update "$git_submodules")
 fi
 
+if [ "$softmmu" = "no" ]; then
+    if [ "$tcg" = "enabled" ]; then
+        echo "WARN: TCG accelerator selected but no target requires it"
+    fi
+    if [ "$kvm" = "enabled" ]; then
+        echo "WARN: KVM accelerator selected but no target requires it"
+    fi
+    if [ "$xen" = "enabled" ]; then
+        echo "WARN: Xen accelerator selected but no target requires it"
+    fi
+    if [ "$hax" = "enabled" ]; then
+        echo "WARN: HAX accelerator selected but no target requires it"
+    fi
+    if [ "$hvf" = "enabled" ]; then
+        echo "WARN: HVF accelerator selected but no target requires it"
+    fi
+    if [ "$whpx" = "enabled" ]; then
+        echo "WARN: WHPX accelerator selected but no target requires it"
+    fi
+fi
+
 config_host_mak="config-host.mak"
 
 echo "# Automatically generated by configure - do not modify" > $config_host_mak
-- 
2.26.2

Re: [PATCH 3/3] configure: Emit warning when accelerator requested but not needed
Posted by Thomas Huth 4 years, 10 months ago
On 20/01/2021 16.19, Philippe Mathieu-Daudé wrote:
> In some configurations it might be pointless to check and
> compile accelerator code. Do not deselect the accelerator,
> but emit a warning.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>   configure | 21 +++++++++++++++++++++
>   1 file changed, 21 insertions(+)
> 
> diff --git a/configure b/configure
> index a5159157a49..09e1cd8bfe6 100755
> --- a/configure
> +++ b/configure
> @@ -5514,6 +5514,27 @@ if test $git_update = 'yes' ; then
>       (cd "${source_path}" && GIT="$git" "./scripts/git-submodule.sh" update "$git_submodules")
>   fi
>   
> +if [ "$softmmu" = "no" ]; then
> +    if [ "$tcg" = "enabled" ]; then
> +        echo "WARN: TCG accelerator selected but no target requires it"
> +    fi

What about linux-user? It needs TCG, but it can also be compiled with 
softmmu disabled, can't it?

  Thomas


Re: [PATCH 3/3] configure: Emit warning when accelerator requested but not needed
Posted by Philippe Mathieu-Daudé 4 years, 10 months ago
On 1/20/21 5:33 PM, Thomas Huth wrote:
> On 20/01/2021 16.19, Philippe Mathieu-Daudé wrote:
>> In some configurations it might be pointless to check and
>> compile accelerator code. Do not deselect the accelerator,
>> but emit a warning.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> ---
>>   configure | 21 +++++++++++++++++++++
>>   1 file changed, 21 insertions(+)
>>
>> diff --git a/configure b/configure
>> index a5159157a49..09e1cd8bfe6 100755
>> --- a/configure
>> +++ b/configure
>> @@ -5514,6 +5514,27 @@ if test $git_update = 'yes' ; then
>>       (cd "${source_path}" && GIT="$git" "./scripts/git-submodule.sh"
>> update "$git_submodules")
>>   fi
>>   +if [ "$softmmu" = "no" ]; then
>> +    if [ "$tcg" = "enabled" ]; then
>> +        echo "WARN: TCG accelerator selected but no target requires it"
>> +    fi
> 
> What about linux-user? It needs TCG, but it can also be compiled with
> softmmu disabled, can't it?

Indeed, thanks for reviewing.