All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: Li Zhang <lizhang@suse.de>
Cc: dgilbert@redhat.com,  cfontana@suse.de,  qemu-devel@nongnu.org
Subject: Re: [PATCH 1/2] multifd: cleanup the function multifd_channel_connect
Date: Wed, 08 Feb 2023 18:59:26 +0100	[thread overview]
Message-ID: <87v8kchwch.fsf@secure.mitica> (raw)
In-Reply-To: <20211222113049.9326-2-lizhang@suse.de> (Li Zhang's message of "Wed, 22 Dec 2021 12:30:48 +0100")

Li Zhang <lizhang@suse.de> wrote:
> Cleanup multifd_channel_connect
>
> Signed-off-by: Li Zhang <lizhang@suse.de>

Reviewed-by: Juan Quintela <quintela@redhat.com>
queued.

> ---
>  migration/multifd.c | 49 ++++++++++++++++++++++-----------------------
>  1 file changed, 24 insertions(+), 25 deletions(-)
>
> diff --git a/migration/multifd.c b/migration/multifd.c
> index 212be1ed04..4ec40739e0 100644
> --- a/migration/multifd.c
> +++ b/migration/multifd.c
> @@ -801,33 +801,32 @@ static bool multifd_channel_connect(MultiFDSendParams *p,
>      trace_multifd_set_outgoing_channel(
>          ioc, object_get_typename(OBJECT(ioc)), p->tls_hostname, error);
>  
> -    if (!error) {
> -        if (s->parameters.tls_creds &&
> -            *s->parameters.tls_creds &&
> -            !object_dynamic_cast(OBJECT(ioc),
> -                                 TYPE_QIO_CHANNEL_TLS)) {
> -            multifd_tls_channel_connect(p, ioc, &error);
> -            if (!error) {
> -                /*
> -                 * tls_channel_connect will call back to this
> -                 * function after the TLS handshake,
> -                 * so we mustn't call multifd_send_thread until then
> -                 */
> -                return true;
> -            } else {
> -                return false;
> -            }
> -        } else {
> -            migration_ioc_register_yank(ioc);
> -            p->registered_yank = true;
> -            p->c = ioc;
> -            qemu_thread_create(&p->thread, p->name, multifd_send_thread, p,
> -                                   QEMU_THREAD_JOINABLE);
> -       }
> -       return true;
> +    if (error) {
> +        return false;
>      }
>  
> -    return false;
> +    if (s->parameters.tls_creds &&
> +        *s->parameters.tls_creds &&
> +        !object_dynamic_cast(OBJECT(ioc),
> +                             TYPE_QIO_CHANNEL_TLS)) {
> +        multifd_tls_channel_connect(p, ioc, &error);
> +        if (error) {
> +            return false;
> +        }
> +        /*
> +         * tls_channel_connect will call back to this
> +         * function after the TLS handshake,
> +         * so we mustn't call multifd_send_thread until then
> +         */
> +        return true;
> +    } else {
> +        migration_ioc_register_yank(ioc);
> +        p->registered_yank = true;
> +        p->c = ioc;
> +        qemu_thread_create(&p->thread, p->name, multifd_send_thread, p,
> +                               QEMU_THREAD_JOINABLE);
> +    }
> +    return true;
>  }
>  
>  static void multifd_new_send_channel_cleanup(MultiFDSendParams *p,



  parent reply	other threads:[~2023-02-08 17:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-22 11:30 [PATCH 0/2] multifd: cleanup some source code Li Zhang
2021-12-22 11:30 ` [PATCH 1/2] multifd: cleanup the function multifd_channel_connect Li Zhang
2022-01-06 10:07   ` Li Zhang
2023-02-08 17:59   ` Juan Quintela [this message]
2021-12-22 11:30 ` [PATCH 2/2] multifd: cleanup the function multifd_send_thread Li Zhang
2022-01-06 10:07   ` Li Zhang
2023-02-08 18:11   ` Juan Quintela

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=87v8kchwch.fsf@secure.mitica \
    --to=quintela@redhat.com \
    --cc=cfontana@suse.de \
    --cc=dgilbert@redhat.com \
    --cc=lizhang@suse.de \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.