diff mbox series

[3/3] migration/colo: Tidy up bql_unlock() around bdrv_activate_all()

Message ID 20240509033106.1321880-3-lizhijian@fujitsu.com (mailing list archive)
State New
Headers show
Series [1/3] migration/colo: Minor fix for colo error message | expand

Commit Message

Zhijian Li (Fujitsu) May 9, 2024, 3:31 a.m. UTC
Make the code more tight.

Cc: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
---
This change/comment suggested by "Michael Tokarev <mjt@tls.msk.ru>" came
a bit late at that time, let's update it together in these minor set
this time.
---
 migration/colo.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Peter Xu May 9, 2024, 1:38 p.m. UTC | #1
On Thu, May 09, 2024 at 11:31:06AM +0800, Li Zhijian via wrote:
> Make the code more tight.
> 
> Cc: Michael Tokarev <mjt@tls.msk.ru>
> Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>

Reviewed-by: Peter Xu <peterx@redhat.com>

> ---
> This change/comment suggested by "Michael Tokarev <mjt@tls.msk.ru>" came
> a bit late at that time, let's update it together in these minor set
> this time.

You can use a tag next time:

Suggested-by: Michael Tokarev <mjt@tls.msk.ru>

> ---
>  migration/colo.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/migration/colo.c b/migration/colo.c
> index 991806c06a..1b6d9da1c8 100644
> --- a/migration/colo.c
> +++ b/migration/colo.c
> @@ -838,12 +838,11 @@ static void *colo_process_incoming_thread(void *opaque)
>      /* Make sure all file formats throw away their mutable metadata */
>      bql_lock();
>      bdrv_activate_all(&local_err);
> +    bql_unlock();
>      if (local_err) {
> -        bql_unlock();
>          error_report_err(local_err);
>          return NULL;
>      }
> -    bql_unlock();
>  
>      failover_init_state();
>  
> -- 
> 2.31.1
> 
>
Zhang, Chen May 11, 2024, 2:51 a.m. UTC | #2
> -----Original Message-----
> From: Li Zhijian <lizhijian@fujitsu.com>
> Sent: Thursday, May 9, 2024 11:31 AM
> To: Peter Xu <peterx@redhat.com>; Fabiano Rosas <farosas@suse.de>
> Cc: Zhang, Hailiang <zhanghailiang@xfusion.com>; qemu-
> devel@nongnu.org; Zhang, Chen <chen.zhang@intel.com>; Li Zhijian
> <lizhijian@fujitsu.com>; Michael Tokarev <mjt@tls.msk.ru>
> Subject: [PATCH 3/3] migration/colo: Tidy up bql_unlock() around
> bdrv_activate_all()
> 
> Make the code more tight.
> 
> Cc: Michael Tokarev <mjt@tls.msk.ru>
> Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>

Reviewed-by: Zhang Chen <chen.zhang@intel.com>

Thanks
Chen

> ---
> This change/comment suggested by "Michael Tokarev <mjt@tls.msk.ru>"
> came a bit late at that time, let's update it together in these minor set this
> time.
> ---
>  migration/colo.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/migration/colo.c b/migration/colo.c index 991806c06a..1b6d9da1c8
> 100644
> --- a/migration/colo.c
> +++ b/migration/colo.c
> @@ -838,12 +838,11 @@ static void *colo_process_incoming_thread(void
> *opaque)
>      /* Make sure all file formats throw away their mutable metadata */
>      bql_lock();
>      bdrv_activate_all(&local_err);
> +    bql_unlock();
>      if (local_err) {
> -        bql_unlock();
>          error_report_err(local_err);
>          return NULL;
>      }
> -    bql_unlock();
> 
>      failover_init_state();
> 
> --
> 2.31.1
diff mbox series

Patch

diff --git a/migration/colo.c b/migration/colo.c
index 991806c06a..1b6d9da1c8 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -838,12 +838,11 @@  static void *colo_process_incoming_thread(void *opaque)
     /* Make sure all file formats throw away their mutable metadata */
     bql_lock();
     bdrv_activate_all(&local_err);
+    bql_unlock();
     if (local_err) {
-        bql_unlock();
         error_report_err(local_err);
         return NULL;
     }
-    bql_unlock();
 
     failover_init_state();