[PATCH v3 02/25] migration: Fix state change at migration_channel_process_incoming

Fabiano Rosas posted 25 patches 1 month ago
Maintainers: Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>, Mark Kanda <mark.kanda@oracle.com>, Ben Chaney <bchaney@akamai.com>, Li Zhijian <lizhijian@fujitsu.com>
There is a newer version of this series
[PATCH v3 02/25] migration: Fix state change at migration_channel_process_incoming
Posted by Fabiano Rosas 1 month ago
When the incoming migration fails during the channel connection phase,
the state transition to FAILED is currently being done in the
MigrationState->state, but the MigrationIncomingState->state is the
one that should be used.

Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
---
 migration/channel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/migration/channel.c b/migration/channel.c
index 92435fa7f7..4768c71455 100644
--- a/migration/channel.c
+++ b/migration/channel.c
@@ -48,7 +48,7 @@ void migration_channel_process_incoming(QIOChannel *ioc)
 
     if (local_err) {
         error_report_err(local_err);
-        migrate_set_state(&s->state, s->state, MIGRATION_STATUS_FAILED);
+        migrate_set_state(&mis->state, mis->state, MIGRATION_STATUS_FAILED);
         if (mis->exit_on_error) {
             exit(EXIT_FAILURE);
         }
-- 
2.51.0
Re: [PATCH v3 02/25] migration: Fix state change at migration_channel_process_incoming
Posted by Prasad Pandit 3 weeks, 6 days ago
On Fri, 9 Jan 2026 at 18:11, Fabiano Rosas <farosas@suse.de> wrote:
> When the incoming migration fails during the channel connection phase,
> the state transition to FAILED is currently being done in the
> MigrationState->state, but the MigrationIncomingState->state is the
> one that should be used.
>
> Reviewed-by: Peter Xu <peterx@redhat.com>
> Signed-off-by: Fabiano Rosas <farosas@suse.de>
> ---
>  migration/channel.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/migration/channel.c b/migration/channel.c
> index 92435fa7f7..4768c71455 100644
> --- a/migration/channel.c
> +++ b/migration/channel.c
> @@ -48,7 +48,7 @@ void migration_channel_process_incoming(QIOChannel *ioc)
>
>      if (local_err) {
>          error_report_err(local_err);
> -        migrate_set_state(&s->state, s->state, MIGRATION_STATUS_FAILED);
> +        migrate_set_state(&mis->state, mis->state, MIGRATION_STATUS_FAILED);
>          if (mis->exit_on_error) {
>              exit(EXIT_FAILURE);
>          }

* Change looks okay. (/me makes a note to see if we could combine
MigrationState and MigrationIncomingState, why couldn't we use the
same struct/object on both source and destination sides?).

Reviewed-by: Prasad Pandit <pjp@fedoraproject.org>

Thank you.
---
  - Prasad
Re: [PATCH v3 02/25] migration: Fix state change at migration_channel_process_incoming
Posted by Fabiano Rosas 3 weeks, 6 days ago
Prasad Pandit <ppandit@redhat.com> writes:

> On Fri, 9 Jan 2026 at 18:11, Fabiano Rosas <farosas@suse.de> wrote:
>> When the incoming migration fails during the channel connection phase,
>> the state transition to FAILED is currently being done in the
>> MigrationState->state, but the MigrationIncomingState->state is the
>> one that should be used.
>>
>> Reviewed-by: Peter Xu <peterx@redhat.com>
>> Signed-off-by: Fabiano Rosas <farosas@suse.de>
>> ---
>>  migration/channel.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/migration/channel.c b/migration/channel.c
>> index 92435fa7f7..4768c71455 100644
>> --- a/migration/channel.c
>> +++ b/migration/channel.c
>> @@ -48,7 +48,7 @@ void migration_channel_process_incoming(QIOChannel *ioc)
>>
>>      if (local_err) {
>>          error_report_err(local_err);
>> -        migrate_set_state(&s->state, s->state, MIGRATION_STATUS_FAILED);
>> +        migrate_set_state(&mis->state, mis->state, MIGRATION_STATUS_FAILED);
>>          if (mis->exit_on_error) {
>>              exit(EXIT_FAILURE);
>>          }
>
> * Change looks okay. (/me makes a note to see if we could combine
> MigrationState and MigrationIncomingState, why couldn't we use the
> same struct/object on both source and destination sides?).
>

The entire structs are a bit big for them to be duplicated. We could
certainly combine individual fields where it makes sense, or extract
some fields into their own structures that only get used in local
contexts. Work to be done.

> Reviewed-by: Prasad Pandit <pjp@fedoraproject.org>
>
> Thank you.
> ---
>   - Prasad