qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Li Zhijian <lizhijian@cn.fujitsu.com>
Cc: qemu-devel@nongnu.org, quintela@redhat.com
Subject: Re: [PATCH RESEND 1/4] migration/rdma: cleanup rmda in rdma_start_incoming_migration error path
Date: Mon, 24 May 2021 20:06:12 +0100	[thread overview]
Message-ID: <YKv5JOhp7bje8R5w@work-vm> (raw)
In-Reply-To: <20210520081148.17001-1-lizhijian@cn.fujitsu.com>

* Li Zhijian (lizhijian@cn.fujitsu.com) wrote:
> the error path after calling qemu_rdma_dest_init() should do rdma cleanup
> 
> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

> ---
>  migration/rdma.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/migration/rdma.c b/migration/rdma.c
> index 41726cc74a..7e7595faab 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, &local_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 / dgilbert@redhat.com / Manchester, UK



      parent reply	other threads:[~2021-05-24 19:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-20  8:11 [PATCH RESEND 1/4] migration/rdma: cleanup rmda in rdma_start_incoming_migration error path Li Zhijian
2021-05-20  8:11 ` [PATCH RESEND 2/4] migration/rdma: Fix rdma_addrinfo res leaks Li Zhijian
2021-05-24 19:03   ` Dr. David Alan Gilbert
2021-05-20  8:11 ` [PATCH RESEND 3/4] migration/rdma: destination: create the return patch after the first accept Li Zhijian
2021-05-20  8:30   ` lizhijian
2021-05-24 19:08     ` Dr. David Alan Gilbert
2021-05-20  8:11 ` [PATCH RESEND 4/4] migration/rdma: source: get accept cm_event from return path in non-block mode Li Zhijian
2021-05-24 19:06 ` Dr. David Alan Gilbert [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YKv5JOhp7bje8R5w@work-vm \
    --to=dgilbert@redhat.com \
    --cc=lizhijian@cn.fujitsu.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).