All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Fabiano Rosas <farosas@suse.de>
Cc: qemu-devel@nongnu.org, berrange@redhat.com
Subject: Re: [PATCH v2 24/25] migration: Remove qmp_migrate_finish
Date: Mon, 5 Jan 2026 16:18:06 -0500	[thread overview]
Message-ID: <aVwqjod_ciTA3Vc0@x1.local> (raw)
In-Reply-To: <20260105190644.14072-25-farosas@suse.de>

On Mon, Jan 05, 2026 at 04:06:41PM -0300, Fabiano Rosas wrote:
> After cleanups, the qmp_migrate_finish function is now just a call to
> migration_connect_outgoing(). Remove qmp_migrate_finish() and rename
> the qmp_migrate_finish_cb callback.
> 
> This also allows the cleanup at qmp_migrate_finish() to move to the
> top level along with everyting else.
> 
> Signed-off-by: Fabiano Rosas <farosas@suse.de>

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

One nitpick:

> ---
>  migration/migration.c | 35 +++++++++++++----------------------
>  1 file changed, 13 insertions(+), 22 deletions(-)
> 
> diff --git a/migration/migration.c b/migration/migration.c
> index a9d5f5880d..2991e01d65 100644
> --- a/migration/migration.c
> +++ b/migration/migration.c
> @@ -1997,15 +1997,18 @@ static bool migrate_prepare(MigrationState *s, bool resume, Error **errp)
>      return true;
>  }
>  
> -static void qmp_migrate_finish(MigrationAddress *addr, Error **errp);
> -
> -static gboolean qmp_migrate_finish_cb(QIOChannel *channel,
> -                                      GIOCondition cond,
> -                                      void *opaque)
> +static gboolean migration_connect_outgoing_cb(QIOChannel *channel,
> +                                              GIOCondition cond, void *opaque)
>  {
> -    MigrationAddress *addr = opaque;
> +    MigrationState *s = migrate_get_current();
> +    Error *local_err = NULL;
> +
> +    migration_connect_outgoing(s, opaque, &local_err);
> +
> +    if (local_err) {
> +        migration_connect_error_propagate(s, local_err);
> +    }
>  
> -    qmp_migrate_finish(addr, NULL);
>      return G_SOURCE_REMOVE;
>  }
>  
> @@ -2059,10 +2062,11 @@ void qmp_migrate(const char *uri, bool has_channels,
>       * connection, so qmp_migrate_finish will fail to connect, and then recover.
>       */
>      if (migrate_mode() == MIG_MODE_CPR_TRANSFER) {
> -        cpr_transfer_add_hup_watch(s, qmp_migrate_finish_cb, main_ch->addr);
> +        cpr_transfer_add_hup_watch(s, migration_connect_outgoing_cb,
> +                                   main_ch->addr);
>  
>      } else {
> -        qmp_migrate_finish(main_ch->addr, errp);
> +        migration_connect_outgoing(s, main_ch->addr, &local_err);

I definitely overlooked that here it used &local_err to replace errp when
looking at this patch the 1st time.  You did mention it in the commit
message on "move to the top level", good enough!  But maybe even better if
spelling it out on the error object being passed in the commit message too.

>      }
>  
>  out:
> @@ -2072,19 +2076,6 @@ out:
>      }
>  }
>  
> -static void qmp_migrate_finish(MigrationAddress *addr, Error **errp)
> -{
> -    MigrationState *s = migrate_get_current();
> -    Error *local_err = NULL;
> -
> -    migration_connect_outgoing(s, addr, &local_err);
> -
> -    if (local_err) {
> -        migration_connect_error_propagate(s, error_copy(local_err));
> -        error_propagate(errp, local_err);
> -    }
> -}
> -
>  void qmp_migrate_cancel(Error **errp)
>  {
>      /*
> -- 
> 2.51.0
> 

-- 
Peter Xu



  reply	other threads:[~2026-01-05 21:19 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-05 19:06 [PATCH v2 00/25] migration: Cleanup early connection code Fabiano Rosas
2026-01-05 19:06 ` [PATCH v2 01/25] migration: Remove redundant state change Fabiano Rosas
2026-01-05 19:06 ` [PATCH v2 02/25] migration: Fix state change at migration_channel_process_incoming Fabiano Rosas
2026-01-05 19:06 ` [PATCH v2 03/25] migration/tls: Remove unused parameter Fabiano Rosas
2026-01-05 19:06 ` [PATCH v2 04/25] migration: Cleanup TLS handshake hostname passing Fabiano Rosas
2026-01-05 19:06 ` [PATCH v2 05/25] migration: Move postcopy_try_recover into migration_incoming_process Fabiano Rosas
2026-01-05 19:06 ` [PATCH v2 06/25] migration: Use migrate_mode() to query for cpr-transfer Fabiano Rosas
2026-01-05 19:06 ` [PATCH v2 07/25] migration: Free the error earlier in the resume case Fabiano Rosas
2026-01-05 19:06 ` [PATCH v2 08/25] migration: Move error reporting out of migration_cleanup Fabiano Rosas
2026-01-05 19:06 ` [PATCH v2 09/25] migration: Expand migration_connect_error_propagate to cover cancelling Fabiano Rosas
2026-01-05 19:06 ` [PATCH v2 10/25] migration: yank: Move register instance earlier Fabiano Rosas
2026-01-05 19:06 ` [PATCH v2 11/25] migration: Fold migration_cleanup() into migration_connect_error_propagate() Fabiano Rosas
2026-01-05 19:06 ` [PATCH v2 12/25] migration: Handle error in the early async paths Fabiano Rosas
2026-01-05 19:06 ` [PATCH v2 13/25] migration: Move setting of QEMUFile into migration_outgoing|incoming_setup Fabiano Rosas
2026-01-05 19:30   ` Peter Xu
2026-01-05 19:06 ` [PATCH v2 14/25] migration/rdma: Use common connection paths Fabiano Rosas
2026-01-05 19:37   ` Peter Xu
2026-01-05 19:06 ` [PATCH v2 15/25] migration: Start incoming from channel.c Fabiano Rosas
2026-01-05 19:41   ` Peter Xu
2026-01-05 19:06 ` [PATCH v2 16/25] migration/channel: Rename migration_channel_connect Fabiano Rosas
2026-01-05 19:44   ` Peter Xu
2026-01-05 19:06 ` [PATCH v2 17/25] migration: Rename instances of start Fabiano Rosas
2026-01-05 19:46   ` Peter Xu
2026-01-05 19:06 ` [PATCH v2 18/25] migration: Move channel code to channel.c Fabiano Rosas
2026-01-05 19:47   ` Peter Xu
2026-01-05 19:06 ` [PATCH v2 19/25] migration: Move transport connection code into channel.c Fabiano Rosas
2026-01-05 19:49   ` Peter Xu
2026-01-05 19:06 ` [PATCH v2 20/25] migration: Move channel parsing to channel.c Fabiano Rosas
2026-01-05 21:00   ` Peter Xu
2026-01-05 19:06 ` [PATCH v2 21/25] migration: Move URI " Fabiano Rosas
2026-01-05 21:01   ` Peter Xu
2026-01-05 19:06 ` [PATCH v2 22/25] migration: Free cpr-transfer MigrationAddress along with gsource Fabiano Rosas
2026-01-05 21:03   ` Peter Xu
2026-01-05 19:06 ` [PATCH v2 23/25] migration: Move CPR HUP watch to cpr-transfer.c Fabiano Rosas
2026-01-05 21:05   ` Peter Xu
2026-01-05 19:06 ` [PATCH v2 24/25] migration: Remove qmp_migrate_finish Fabiano Rosas
2026-01-05 21:18   ` Peter Xu [this message]
2026-01-05 19:06 ` [PATCH v2 25/25] migration/channel: Centralize calling migration_channel_connect_outgoing Fabiano Rosas
2026-01-05 21:32   ` Peter Xu
2026-01-06 13:55     ` Fabiano Rosas

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=aVwqjod_ciTA3Vc0@x1.local \
    --to=peterx@redhat.com \
    --cc=berrange@redhat.com \
    --cc=farosas@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.