diff mbox series

[v2,1/6] cpus: Properly release the iothread lock when killing a dummy VCPU

Message ID 20190215133005.15955-2-david@redhat.com (mailing list archive)
State New, archived
Headers show
Series tests: Add device unplug tests | expand

Commit Message

David Hildenbrand Feb. 15, 2019, 1:30 p.m. UTC
This enables CPU unplug under qtest.

Signed-off-by: David Hildenbrand <david@redhat.com>
---
 cpus.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Greg Kurz Feb. 15, 2019, 2:53 p.m. UTC | #1
On Fri, 15 Feb 2019 14:30:00 +0100
David Hildenbrand <david@redhat.com> wrote:

> This enables CPU unplug under qtest.
> 
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---

Reviewed-by: Greg Kurz <groug@kaod.org>

>  cpus.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/cpus.c b/cpus.c
> index 154daf57dc..e83f72b48b 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -1333,6 +1333,7 @@ static void *qemu_dummy_cpu_thread_fn(void *arg)
>          qemu_wait_io_event(cpu);
>      } while (!cpu->unplug);
>  
> +    qemu_mutex_unlock_iothread();
>      rcu_unregister_thread();
>      return NULL;
>  #endif
Thomas Huth Feb. 15, 2019, 3:14 p.m. UTC | #2
On 15/02/2019 14.30, David Hildenbrand wrote:
> This enables CPU unplug under qtest.
> 
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---
>  cpus.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/cpus.c b/cpus.c
> index 154daf57dc..e83f72b48b 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -1333,6 +1333,7 @@ static void *qemu_dummy_cpu_thread_fn(void *arg)
>          qemu_wait_io_event(cpu);
>      } while (!cpu->unplug);
>  
> +    qemu_mutex_unlock_iothread();
>      rcu_unregister_thread();
>      return NULL;
>  #endif

That's definitely a bug that you fix here.

Reviewed-by: Thomas Huth <thuth@redhat.com>
David Gibson Feb. 17, 2019, 11:58 p.m. UTC | #3
On Fri, Feb 15, 2019 at 02:30:00PM +0100, David Hildenbrand wrote:
> This enables CPU unplug under qtest.
> 
> Signed-off-by: David Hildenbrand <david@redhat.com>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  cpus.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/cpus.c b/cpus.c
> index 154daf57dc..e83f72b48b 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -1333,6 +1333,7 @@ static void *qemu_dummy_cpu_thread_fn(void *arg)
>          qemu_wait_io_event(cpu);
>      } while (!cpu->unplug);
>  
> +    qemu_mutex_unlock_iothread();
>      rcu_unregister_thread();
>      return NULL;
>  #endif
diff mbox series

Patch

diff --git a/cpus.c b/cpus.c
index 154daf57dc..e83f72b48b 100644
--- a/cpus.c
+++ b/cpus.c
@@ -1333,6 +1333,7 @@  static void *qemu_dummy_cpu_thread_fn(void *arg)
         qemu_wait_io_event(cpu);
     } while (!cpu->unplug);
 
+    qemu_mutex_unlock_iothread();
     rcu_unregister_thread();
     return NULL;
 #endif