diff mbox series

[1/7] migration/dirtyrate: Do not unlock cpu_list lock twice

Message ID 20250128135429.8500-2-philmd@linaro.org
State New
Headers show
Series tests/qtest/migration: Update framework to allow using HVF accelerator | expand

Commit Message

Philippe Mathieu-Daudé Jan. 28, 2025, 1:54 p.m. UTC
&qemu_cpu_list_lock is locked within the WITH_QEMU_LOCK_GUARD()
context, then unlocked. No need to manually unlock it.

Fixes: 370ed600296 ("cpu: expose qemu_cpu_list_lock for lock-guard use")
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 migration/dirtyrate.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Fabiano Rosas Jan. 28, 2025, 2:27 p.m. UTC | #1
Philippe Mathieu-Daudé <philmd@linaro.org> writes:

> &qemu_cpu_list_lock is locked within the WITH_QEMU_LOCK_GUARD()
> context, then unlocked. No need to manually unlock it.
>
> Fixes: 370ed600296 ("cpu: expose qemu_cpu_list_lock for lock-guard use")
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  migration/dirtyrate.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/migration/dirtyrate.c b/migration/dirtyrate.c
> index 7c955894e47..4b94dd7c500 100644
> --- a/migration/dirtyrate.c
> +++ b/migration/dirtyrate.c
> @@ -174,7 +174,6 @@ retry:
>          if (gen_id != cpu_list_generation_id_get()) {
>              g_free(records);
>              g_free(stat->rates);
> -            cpu_list_unlock();
>              goto retry;
>          }
>          vcpu_dirty_stat_collect(records, false);

Reviewed-by: Fabiano Rosas <farosas@suse.de>
Richard Henderson Jan. 28, 2025, 7:16 p.m. UTC | #2
On 1/28/25 05:54, Philippe Mathieu-Daudé wrote:
> &qemu_cpu_list_lock is locked within the WITH_QEMU_LOCK_GUARD()
> context, then unlocked. No need to manually unlock it.
> 
> Fixes: 370ed600296 ("cpu: expose qemu_cpu_list_lock for lock-guard use")
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
>   migration/dirtyrate.c | 1 -
>   1 file changed, 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
diff mbox series

Patch

diff --git a/migration/dirtyrate.c b/migration/dirtyrate.c
index 7c955894e47..4b94dd7c500 100644
--- a/migration/dirtyrate.c
+++ b/migration/dirtyrate.c
@@ -174,7 +174,6 @@  retry:
         if (gen_id != cpu_list_generation_id_get()) {
             g_free(records);
             g_free(stat->rates);
-            cpu_list_unlock();
             goto retry;
         }
         vcpu_dirty_stat_collect(records, false);