Re: [PATCH v2 1/4] migration/rdma: cleanup rmda in rdma_start_incoming_migration error path

2021-05-26 Thread Dr. David Alan Gilbert
* Li Zhijian (lizhij...@cn.fujitsu.com) wrote:
> the error path after calling qemu_rdma_dest_init() should do rdma cleanup
> 
> Signed-off-by: Li Zhijian 
> Reviewed-by: Dr. David Alan Gilbert 

Queued

> ---
>  migration/rdma.c | 7 +--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/migration/rdma.c b/migration/rdma.c
> index 41726cc74a8..7e7595faabf 100644
> --- a/migration/rdma.c
> +++ b/migration/rdma.c
> @@ -4040,7 +4040,7 @@ void rdma_start_incoming_migration(const char 
> *host_port, Error **errp)
>  
>  if (ret) {
>  ERROR(errp, "listening on socket!");
> -goto err;
> +goto cleanup_rdma;
>  }
>  
>  trace_rdma_start_incoming_migration_after_rdma_listen();
> @@ -4050,7 +4050,7 @@ void rdma_start_incoming_migration(const char 
> *host_port, Error **errp)
>  rdma_return_path = qemu_rdma_data_init(host_port, _err);
>  
>  if (rdma_return_path == NULL) {
> -goto err;
> +goto cleanup_rdma;
>  }
>  
>  qemu_rdma_return_path_dest_init(rdma_return_path, rdma);
> @@ -4059,6 +4059,9 @@ void rdma_start_incoming_migration(const char 
> *host_port, Error **errp)
>  qemu_set_fd_handler(rdma->channel->fd, rdma_accept_incoming_migration,
>  NULL, (void *)(intptr_t)rdma);
>  return;
> +
> +cleanup_rdma:
> +qemu_rdma_cleanup(rdma);
>  err:
>  error_propagate(errp, local_err);
>  if (rdma) {
> -- 
> 2.30.2
> 
> 
> 
> 
-- 
Dr. David Alan Gilbert / dgilb...@redhat.com / Manchester, UK




[PATCH v2 1/4] migration/rdma: cleanup rmda in rdma_start_incoming_migration error path

2021-05-25 Thread Li Zhijian
the error path after calling qemu_rdma_dest_init() should do rdma cleanup

Signed-off-by: Li Zhijian 
Reviewed-by: Dr. David Alan Gilbert 
---
 migration/rdma.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/migration/rdma.c b/migration/rdma.c
index 41726cc74a8..7e7595faabf 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -4040,7 +4040,7 @@ void rdma_start_incoming_migration(const char *host_port, 
Error **errp)
 
 if (ret) {
 ERROR(errp, "listening on socket!");
-goto err;
+goto cleanup_rdma;
 }
 
 trace_rdma_start_incoming_migration_after_rdma_listen();
@@ -4050,7 +4050,7 @@ void rdma_start_incoming_migration(const char *host_port, 
Error **errp)
 rdma_return_path = qemu_rdma_data_init(host_port, _err);
 
 if (rdma_return_path == NULL) {
-goto err;
+goto cleanup_rdma;
 }
 
 qemu_rdma_return_path_dest_init(rdma_return_path, rdma);
@@ -4059,6 +4059,9 @@ void rdma_start_incoming_migration(const char *host_port, 
Error **errp)
 qemu_set_fd_handler(rdma->channel->fd, rdma_accept_incoming_migration,
 NULL, (void *)(intptr_t)rdma);
 return;
+
+cleanup_rdma:
+qemu_rdma_cleanup(rdma);
 err:
 error_propagate(errp, local_err);
 if (rdma) {
-- 
2.30.2