[PATCH v2 1/3] accel: Remove _WIN32 ifdef from qtest-cpus.c

Jason Andryuk posted 3 patches 5 years, 3 months ago
Maintainers: Richard Henderson <rth@twiddle.net>, Stefano Stabellini <sstabellini@kernel.org>, Paolo Bonzini <pbonzini@redhat.com>, Thomas Huth <thuth@redhat.com>, Laurent Vivier <lvivier@redhat.com>, Anthony Perard <anthony.perard@citrix.com>, Paul Durrant <paul@xen.org>
There is a newer version of this series
[PATCH v2 1/3] accel: Remove _WIN32 ifdef from qtest-cpus.c
Posted by Jason Andryuk 5 years, 3 months ago
dummy-cpus.c is only compiled with CONFIG_POSIX, so the _WIN32 condition
will never evaluate true.  Remove it.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
---
v2: New in v2
---
 accel/qtest/qtest-cpus.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/accel/qtest/qtest-cpus.c b/accel/qtest/qtest-cpus.c
index 7c5399ed9d..db094201c1 100644
--- a/accel/qtest/qtest-cpus.c
+++ b/accel/qtest/qtest-cpus.c
@@ -29,10 +29,6 @@
 
 static void *qtest_cpu_thread_fn(void *arg)
 {
-#ifdef _WIN32
-    error_report("qtest is not supported under Windows");
-    exit(1);
-#else
     CPUState *cpu = arg;
     sigset_t waitset;
     int r;
@@ -69,7 +65,6 @@ static void *qtest_cpu_thread_fn(void *arg)
     qemu_mutex_unlock_iothread();
     rcu_unregister_thread();
     return NULL;
-#endif
 }
 
 static void qtest_start_vcpu_thread(CPUState *cpu)
-- 
2.25.1


Re: [PATCH v2 1/3] accel: Remove _WIN32 ifdef from qtest-cpus.c
Posted by Claudio Fontana 5 years, 3 months ago
On 10/13/20 4:05 PM, Jason Andryuk wrote:
> dummy-cpus.c is only compiled with CONFIG_POSIX, so the _WIN32 condition
> will never evaluate true.  Remove it.
> 
> Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
> ---
> v2: New in v2
> ---
>  accel/qtest/qtest-cpus.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/accel/qtest/qtest-cpus.c b/accel/qtest/qtest-cpus.c
> index 7c5399ed9d..db094201c1 100644
> --- a/accel/qtest/qtest-cpus.c
> +++ b/accel/qtest/qtest-cpus.c
> @@ -29,10 +29,6 @@
>  
>  static void *qtest_cpu_thread_fn(void *arg)
>  {
> -#ifdef _WIN32
> -    error_report("qtest is not supported under Windows");
> -    exit(1);
> -#else
>      CPUState *cpu = arg;
>      sigset_t waitset;
>      int r;
> @@ -69,7 +65,6 @@ static void *qtest_cpu_thread_fn(void *arg)
>      qemu_mutex_unlock_iothread();
>      rcu_unregister_thread();
>      return NULL;
> -#endif
>  }
>  
>  static void qtest_start_vcpu_thread(CPUState *cpu)
> 
Reviewed-by: Claudio Fontana <cfontana@suse.de>

Re: [PATCH v2 1/3] accel: Remove _WIN32 ifdef from qtest-cpus.c
Posted by Philippe Mathieu-Daudé 5 years, 3 months ago
On 10/13/20 4:05 PM, Jason Andryuk wrote:
> dummy-cpus.c is only compiled with CONFIG_POSIX, so the _WIN32 condition
> will never evaluate true.  Remove it.

I disagree with this removal, as you are making this a generic
accelerator out of QTest. I'd rather keep this and replace the
error message with "Dummy accelerator is not supported on
Windows" and not make it POSIX-specific. As Paolo already acked
this patch so I am not objecting to it.

> 
> Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
> ---
> v2: New in v2
> ---
>   accel/qtest/qtest-cpus.c | 5 -----
>   1 file changed, 5 deletions(-)
> 
> diff --git a/accel/qtest/qtest-cpus.c b/accel/qtest/qtest-cpus.c
> index 7c5399ed9d..db094201c1 100644
> --- a/accel/qtest/qtest-cpus.c
> +++ b/accel/qtest/qtest-cpus.c
> @@ -29,10 +29,6 @@
>   
>   static void *qtest_cpu_thread_fn(void *arg)
>   {
> -#ifdef _WIN32
> -    error_report("qtest is not supported under Windows");
> -    exit(1);
> -#else
>       CPUState *cpu = arg;
>       sigset_t waitset;
>       int r;
> @@ -69,7 +65,6 @@ static void *qtest_cpu_thread_fn(void *arg)
>       qemu_mutex_unlock_iothread();
>       rcu_unregister_thread();
>       return NULL;
> -#endif
>   }
>   
>   static void qtest_start_vcpu_thread(CPUState *cpu)
> 


Re: [PATCH v2 1/3] accel: Remove _WIN32 ifdef from qtest-cpus.c
Posted by Thomas Huth 5 years, 3 months ago
On 13/10/2020 16.05, Jason Andryuk wrote:
> dummy-cpus.c is only compiled with CONFIG_POSIX, so the _WIN32 condition
> will never evaluate true.  Remove it.
> 
> Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
> ---
> v2: New in v2
> ---
>  accel/qtest/qtest-cpus.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/accel/qtest/qtest-cpus.c b/accel/qtest/qtest-cpus.c
> index 7c5399ed9d..db094201c1 100644
> --- a/accel/qtest/qtest-cpus.c
> +++ b/accel/qtest/qtest-cpus.c
> @@ -29,10 +29,6 @@
>  
>  static void *qtest_cpu_thread_fn(void *arg)
>  {
> -#ifdef _WIN32
> -    error_report("qtest is not supported under Windows");
> -    exit(1);
> -#else
>      CPUState *cpu = arg;
>      sigset_t waitset;
>      int r;
> @@ -69,7 +65,6 @@ static void *qtest_cpu_thread_fn(void *arg)
>      qemu_mutex_unlock_iothread();
>      rcu_unregister_thread();
>      return NULL;
> -#endif
>  }
>  
>  static void qtest_start_vcpu_thread(CPUState *cpu)
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>