From: Peter Xu <peterx@redhat.com>
To: Fabiano Rosas <farosas@suse.de>
Cc: qemu-devel@nongnu.org
Subject: Re: [RFC PATCH 04/25] migration: Move multifd_recv_setup call
Date: Mon, 29 Dec 2025 10:51:03 -0500 [thread overview]
Message-ID: <aVKjZyDWVH5ouvdV@x1.local> (raw)
In-Reply-To: <20251226211930.27565-5-farosas@suse.de>
On Fri, Dec 26, 2025 at 06:19:06PM -0300, Fabiano Rosas wrote:
> The multifd_recv_setup() call is currently in a place where it will be
> called for every channel that appears. That doesn't make much
> sense.
>
> It seems it was moved when the channel discovery mechanism was added
> back at commit 6720c2b327 (migration: check magic value for deciding
> the mapping of channels, 2022-12-20). The original place was
> migration_incoming_setup() which would run for just the main channel,
> but it was discovered that the main channel might arrive after a
> multifd channel.
>
> Move the call back to a place where it will be called only once.
>
> With respect to cleanup, this new location at
> qemu_start_incoming_migration() has the same issue as the previous
> callsite at migration_ioc_process_incoming(): no cleanup ever happens.
>
> The error message goes from being emitted via error_report_err(), to
> being returned to the qmp_migrate_incoming() incoming command, which
> is arguably better, since this is setup code.
This is not the only and real reason that you moved it, right?
Neither should it be the reason that you want it to be called only exactly
once; after all the function will be no-op in the 2nd+ calls.
I'll keep reading.. I'm guessing I'll find it later, but IMHO it'll always
be good to mention the real motivation in the commit log.
>
> Signed-off-by: Fabiano Rosas <farosas@suse.de>
> ---
> migration/migration.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/migration/migration.c b/migration/migration.c
> index 71efe945f6..974313944c 100644
> --- a/migration/migration.c
> +++ b/migration/migration.c
> @@ -786,6 +786,10 @@ static void qemu_start_incoming_migration(const char *uri, bool has_channels,
> return;
> }
>
> + if (multifd_recv_setup(errp) != 0) {
> + return;
> + }
> +
> if (addr->transport == MIGRATION_ADDRESS_TYPE_SOCKET) {
> SocketAddress *saddr = &addr->u.socket;
> if (saddr->type == SOCKET_ADDRESS_TYPE_INET ||
> @@ -1065,10 +1069,6 @@ void migration_ioc_process_incoming(QIOChannel *ioc, Error **errp)
> channel = CH_POSTCOPY;
> }
>
> - if (multifd_recv_setup(errp) != 0) {
> - return;
> - }
> -
> if (channel == CH_MAIN) {
> f = qemu_file_new_input(ioc);
> migration_incoming_setup(f);
> --
> 2.51.0
>
--
Peter Xu
next prev parent reply other threads:[~2025-12-29 15:52 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-26 21:19 [RFC PATCH 00/25] migration: Cleanup early connection code Fabiano Rosas
2025-12-26 21:19 ` [RFC PATCH 01/25] migration: Remove redundant state change Fabiano Rosas
2025-12-29 15:22 ` Peter Xu
2025-12-26 21:19 ` [RFC PATCH 02/25] migration: Fix state change at migration_channel_process_incoming Fabiano Rosas
2025-12-29 15:32 ` Peter Xu
2025-12-26 21:19 ` [RFC PATCH 03/25] migration/tls: Remove unused parameter Fabiano Rosas
2025-12-29 15:33 ` Peter Xu
2025-12-26 21:19 ` [RFC PATCH 04/25] migration: Move multifd_recv_setup call Fabiano Rosas
2025-12-29 15:51 ` Peter Xu [this message]
2025-12-29 19:21 ` Fabiano Rosas
2025-12-26 21:19 ` [RFC PATCH 05/25] migration: Cleanup TLS handshake hostname passing Fabiano Rosas
2025-12-29 16:12 ` Peter Xu
2025-12-29 19:38 ` Fabiano Rosas
2025-12-26 21:19 ` [RFC PATCH 06/25] migration: Move postcopy_try_recover into migration_incoming_process Fabiano Rosas
2025-12-29 16:15 ` Peter Xu
2025-12-26 21:19 ` [RFC PATCH 07/25] migration: Use migrate_mode() to query for cpr-transfer Fabiano Rosas
2025-12-29 16:33 ` Peter Xu
2025-12-29 19:23 ` Fabiano Rosas
2025-12-26 21:19 ` [RFC PATCH 08/25] migration: Free the error earlier in the resume case Fabiano Rosas
2025-12-29 16:39 ` [RFC PATCH 08/25] migration: Free the error earlier in the resume case' Peter Xu
2025-12-26 21:19 ` [RFC PATCH 09/25] migration: Move error reporting out of migration_cleanup Fabiano Rosas
2025-12-29 16:45 ` Peter Xu
2025-12-26 21:19 ` [RFC PATCH 10/25] migration: Expand migration_connect_error_propagate to cover cancelling Fabiano Rosas
2025-12-29 17:12 ` Peter Xu
2025-12-26 21:19 ` [RFC PATCH 11/25] migration: yank: Move register instance earlier Fabiano Rosas
2025-12-29 17:17 ` Peter Xu
2025-12-26 21:19 ` [RFC PATCH 12/25] migration: Fold migration_cleanup() into migration_connect_error_propagate() Fabiano Rosas
2025-12-29 18:42 ` Peter Xu
2025-12-29 19:26 ` Fabiano Rosas
2025-12-26 21:19 ` [RFC PATCH 13/25] migration: Handle error in the early async paths Fabiano Rosas
2025-12-29 19:08 ` Peter Xu
2025-12-29 19:35 ` Fabiano Rosas
2025-12-26 21:19 ` [RFC PATCH 14/25] migration: Remove QEMUFile from channel.c Fabiano Rosas
2025-12-29 19:36 ` Peter Xu
2025-12-29 19:51 ` Fabiano Rosas
2025-12-26 21:19 ` [RFC PATCH 15/25] migration/channel: Rename migration_channel_connect Fabiano Rosas
2025-12-29 19:40 ` Peter Xu
2025-12-26 21:19 ` [RFC PATCH 16/25] migration: Rename instances of start Fabiano Rosas
2025-12-26 21:19 ` [RFC PATCH 17/25] migration: Move channel code to channel.c Fabiano Rosas
2025-12-26 21:19 ` [RFC PATCH 18/25] migration: Move transport connection code into channel.c Fabiano Rosas
2025-12-26 21:19 ` [RFC PATCH 19/25] migration/channel: Make synchronous calls evident Fabiano Rosas
2025-12-26 21:19 ` [RFC PATCH 20/25] migration/channel: Use switch statements in outgoing code Fabiano Rosas
2025-12-26 21:19 ` [RFC PATCH 21/25] migration/channel: Cleanup early passing of MigrationState Fabiano Rosas
2025-12-26 21:19 ` [RFC PATCH 22/25] migration/channel: Merge both sides of the connection initiation code Fabiano Rosas
2025-12-29 20:06 ` Peter Xu
2025-12-29 21:14 ` Fabiano Rosas
2025-12-29 22:05 ` Peter Xu
2025-12-26 21:19 ` [RFC PATCH 23/25] migration: Move channel parsing to channel.c Fabiano Rosas
2025-12-29 21:01 ` Peter Xu
2025-12-26 21:19 ` [RFC PATCH 24/25] migration: Move URI " Fabiano Rosas
2025-12-29 21:08 ` Peter Xu
2025-12-29 21:22 ` Fabiano Rosas
2025-12-29 22:11 ` Peter Xu
2025-12-26 21:19 ` [RFC PATCH 25/25] migration: Remove qmp_migrate_finish 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=aVKjZyDWVH5ouvdV@x1.local \
--to=peterx@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.