Some minor fixes for migration states
cover Some minor fixes for migration states
This series solved some fixme and comments in code. Please see the details in each patch commit message.
Zhang Chen (3):
migration/migration.c: Add missed default error handler for migration
state
migration/migration.c: Avoid COLO boot in postcopy migration migration/migration.c: Remove the MIGRATION_STATUS_ACTIVE when
migration finished
migration/migration.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-)
Signature · 1 line
2.25.1
PATCH 1/3 migration/migration.c: Add missed default error handler for migration state
In the migration_completion() no other status is expected, for example MIGRATION_STATUS_CANCELLING, MIGRATION_STATUS_CANCELLED, etc.
--- migration/migration.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
migration/migration.c +1 -1
@@ -3205,7 +3205,7 @@ static void migration_completion(MigrationState *s)qemu_mutex_unlock_iothread ();trace_migration_completion_postcopy_end_after_complete (); - }else if (s->state ==MIGRATION_STATUS_CANCELLING ) { + }else { goto fail; }
Signature · 1 line
2.25.1
Re: [PATCH 1/3] migration/migration.c: Add missed default error handler for migration state
Quoted 4 lines · * Zhang Chen ([email protected]) wrote:
In the
migration_completion()no other status is expected, for exampleMIGRATION_STATUS_CANCELLING,MIGRATION_STATUS_CANCELLED, etc.Signed-off-by Zhang Chen <[email protected]>
I think you're right;
however, did you actually see this trigger in a different state?
Dave
Quoted 20 lines
--- migration/migration.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)migration/migration.c +1
-1@@ -3205,7 +3205,7 @@ static void migration_completion(MigrationState *s)qemu_mutex_unlock_iothread ();trace_migration_completion_postcopy_end_after_complete (); - }else if (s->state ==MIGRATION_STATUS_CANCELLING ) { + }else { goto fail; }Signature · 1 line
2.25.1
Signature · 1 line
Dr. David Alan Gilbert / [email protected] / Manchester, UK
RE: [PATCH 1/3] migration/migration.c: Add missed default error handler for migration state
Quoted 15 lines
-----Original Message-----
From: Dr. David Alan Gilbert <[email protected]>
Sent: Thursday, January 20, 2022 1:52 AM
To: Zhang, Chen <[email protected]>
Cc: Juan Quintela <[email protected]>; qemu-dev <qemu- [email protected]>
Subject: Re: [PATCH 1/3]migration/migration.c: Add missed default error handler for migration stateQuoted 3 lines · * Zhang Chen ([email protected]) wrote:
In the
migration_completion()no other status is expected, for exampleMIGRATION_STATUS_CANCELLING,MIGRATION_STATUS_CANCELLED, etc.
Quoted 7 lines
Quoted 1 line
Signed-off-by Zhang Chen <[email protected]>I think you're right;
Reviewed-by Dr. David Alan Gilbert <[email protected]>however, did you actually see this trigger in a different state?
No, I just read the code and found it.
Thanks
Chen
Quoted 25 lines
Dave
migration/migration.c static void migration_completion(MigrationState
Quoted 9 lines
--- migration/migration.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)migration/migration.c index renamed from migration/migration.c +0
-00652165610..2afa77da03 100644
migration/migration.c +0
-0@@ -3205,7 +3205,7 @@ static void migration_completion(MigrationState*s)
Quoted 11 lines
migration/migration.c +1
-2qemu_mutex_unlock_iothread ();trace_migration_completion_postcopy_end_after_complete (); - }else if (s->state ==MIGRATION_STATUS_CANCELLING ) { + }else { goto fail; } --2.25.1
--
Dr. David Alan Gilbert / [email protected] / Manchester, UK
Re: [PATCH 1/3] migration/migration.c: Add missed default error handler for migration state
In reply to Zhang ChenQuoted 4 lines · Zhang Chen
In the
migration_completion()no other status is expected, for exampleMIGRATION_STATUS_CANCELLING,MIGRATION_STATUS_CANCELLED, etc.Signed-off-by Zhang Chen <[email protected]>
queued
PATCH 2/3 migration/migration.c: Avoid COLO boot in postcopy migration
In reply to Zhang ChenCOLO dose not support postcopy migration and remove the Fixme.
--- migration/migration.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
migration/migration.c +5 -5
@@ -3230,7 +3230,11 @@ static void migration_completion(MigrationState *s) goto fail_invalidate; } -if (!migrate_colo_enabled ()) { +if (migrate_colo_enabled () && s->state ==MIGRATION_STATUS_ACTIVE ) { +/* COLO dose not support postcopy */ +migrate_set_state (&s->state,MIGRATION_STATUS_ACTIVE , +MIGRATION_STATUS_COLO ); + }else {migrate_set_state (&s->state, current_active_state,MIGRATION_STATUS_COMPLETED ); }
@@ -3621,10 +3625,6 @@ static void migration_iteration_finish(MigrationState *s) "COLO enabled", __func__); }migrate_start_colo_process (s); -/* -* Fixme: we will run VM in COLO no matter its old running state. -* After exited COLO, we will keep running. -*/ /* Fallthrough */ case MIGRATION_STATUS_ACTIVE :/*
Signature · 1 line
2.25.1
Re: [PATCH 2/3] migration/migration.c: Avoid COLO boot in postcopy migration
Quoted 1 line · * Zhang Chen ([email protected]) wrote:
COLO dose not support postcopy migration and remove the Fixme.
'does' not 'dose'
Quoted 10 lines
Signed-off-by Zhang Chen <[email protected]>--- migration/migration.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)migration/migration.c +0
-0
migration/migration.c static void migration_completion(MigrationState *s) · line 3236
Quoted 8 lines
migration/migration.c +4
-1@@ -3230,7 +3230,11 @@ static void migration_completion(MigrationState *s) goto fail_invalidate; } -if (!migrate_colo_enabled ()) { +if (migrate_colo_enabled () && s->state ==MIGRATION_STATUS_ACTIVE ) { +/* COLO dose not support postcopy */ +migrate_set_state (&s->state,MIGRATION_STATUS_ACTIVE , +MIGRATION_STATUS_COLO );
I'm a bit confused; where were we setting the source state to COLO before - I can't find it!
Dave
Quoted 18 lines
migration/migration.c +1
-4+ }else {migrate_set_state (&s->state, current_active_state,MIGRATION_STATUS_COMPLETED ); }@@ -3621,10 +3625,6 @@ static void migration_iteration_finish(MigrationState *s) "COLO enabled", __func__); }migrate_start_colo_process (s); -/* -* Fixme: we will run VM in COLO no matter its old running state. -* After exited COLO, we will keep running. -*/ /* Fallthrough */ case MIGRATION_STATUS_ACTIVE :/* Signature · 1 line
2.25.1
Signature · 1 line
Dr. David Alan Gilbert / [email protected] / Manchester, UK
RE: [PATCH 2/3] migration/migration.c: Avoid COLO boot in postcopy migration
Quoted 11 lines
-----Original Message-----
From: Dr. David Alan Gilbert <[email protected]>
Sent: Thursday, January 20, 2022 3:41 AM
To: Zhang, Chen <[email protected]>
Cc: Juan Quintela <[email protected]>; qemu-dev <qemu- [email protected]>
Subject: Re: [PATCH 2/3]migration/migration.c: Avoid COLO boot in postcopy migration
Quoted 6 lines
Quoted 1 line · * Zhang Chen ([email protected]) wrote:
COLO dose not support postcopy migration and remove the Fixme.
'does' not 'dose'
Yes, typo.
Quoted 16 lines
migration/migration.c static void migration_completion(MigrationState
Quoted 10 lines
Signed-off-by Zhang Chen <[email protected]>--- migration/migration.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)migration/migration.c index renamed from migration/migration.c +0
-0
2afa77da03..3fac9c67ca100644migration/migration.c +0
-0@@ -3230,7 +3230,11 @@ static void migration_completion(MigrationState*s)
migration/migration.c static void migration_completion(MigrationState *s)
Quoted 5 lines
migration/migration.c +1
-1goto fail_invalidate; } -if (!migrate_colo_enabled ()) { + if (migrate_colo_enabled() && s->state ==
Quoted 7 lines
MIGRATION_STATUS_ACTIVE) {migration/migration.c static void migration_completion(MigrationState *s) · line 3236
Quoted 3 lines
migration/migration.c +3
-0+/* COLO dose not support postcopy */ +migrate_set_state (&s->state,MIGRATION_STATUS_ACTIVE , +MIGRATION_STATUS_COLO );I'm a bit confused; where were we setting the source state to COLO before - I can't find it!
Yes, please read this mail:
https://lists.gnu.org/archive/html/qemu-devel/2021-11/msg03525.html
After that I found I missed something, so this patch disabled postcopy migration and try to fix it.
Thanks
Chen
Quoted 24 lines
Dave
migration/migration.c static void
Quoted 5 lines
migration/migration.c +1
-0+ }else {migrate_set_state (&s->state, current_active_state,MIGRATION_STATUS_COMPLETED ); }@@ -3621,10 +3625,6 @@ static void
migration_iteration_finish(MigrationState *s)Quoted 11 lines
migration/migration.c +0
-5"COLO enabled", __func__); }migrate_start_colo_process (s); -/* -* Fixme: we will run VM in COLO no matter its old running state. -* After exited COLO, we will keep running. -*/ /* Fallthrough */ case MIGRATION_STATUS_ACTIVE :/* -- Quoted 2 lines
2.25.1
--
Dr. David Alan Gilbert / [email protected] / Manchester, UK
Re: [PATCH 2/3] migration/migration.c: Avoid COLO boot in postcopy migration
In reply to Zhang ChenQuoted 3 lines · Zhang Chen
COLO dose not support postcopy migration and remove the Fixme.
Signed-off-by Zhang Chen <[email protected]>
fixed the typo.
RE: [PATCH 2/3] migration/migration.c: Avoid COLO boot in postcopy migration
Quoted 11 lines
-----Original Message-----
From: Juan Quintela <[email protected]>
Sent: Thursday, January 27, 2022 3:30 AM
To: Zhang, Chen <[email protected]>
Cc: Dr. David Alan Gilbert <[email protected]>; qemu-dev <qemu- [email protected]>
Subject: Re: [PATCH 2/3]migration/migration.c: Avoid COLO boot in postcopy migration
Quoted 8 lines
Quoted 3 lines · Zhang Chen
COLO dose not support postcopy migration and remove the Fixme.
Signed-off-by Zhang Chen <[email protected]>Reviewed-by Juan Quintela <[email protected]>fixed the typo.
OK, already updated V2 for this series.
Thanks
Chen
PATCH 3/3 migration/migration.c: Remove the MIGRATION_STATUS_ACTIVE when migration finished
In reply to Zhang ChenThe MIGRATION_STATUS_ACTIVE indicates that migration is running. Remove it to be handled by the default operation,
It should be part of the unknown ending states.
--- migration/migration.c | 6 ------ 1 file changed, 6 deletions(-)
migration/migration.c +0 -6
@@ -3625,12 +3625,6 @@ static void migration_iteration_finish(MigrationState *s) "COLO enabled", __func__); }migrate_start_colo_process (s); -/* Fallthrough */ -case MIGRATION_STATUS_ACTIVE : -/* -* We should really assert here, but since it's during -* migration, let's try to reduce the usage of assertions. -*/ s->vm_was_running = true;/* Fallthrough */ case MIGRATION_STATUS_FAILED :
Signature · 1 line
2.25.1
Re: [PATCH 3/3] migration/migration.c: Remove the MIGRATION_STATUS_ACTIVE when migration finished
Quoted 5 lines · Zhang Chen
The
MIGRATION_STATUS_ACTIVEindicates that migration is running. Remove it to be handled by the default operation,
It should be part of the unknown ending states.Signed-off-by Zhang Chen <[email protected]>
queued
Any comments? Ping...
Thanks
Chen
Quoted 23 lines
-----Original Message-----
From: Zhang, Chen <[email protected]>
Sent: Friday, December 31, 2021 2:00 PM
To: Dr. David Alan Gilbert <[email protected]>; Juan Quintela <[email protected]>; qemu-dev <[email protected]>
Cc: Zhang, Chen <[email protected]>
Subject: [PATCH 0/3] Some minor fixes for migration statesThis series solved some fixme and comments in code. Please see the details in each patch commit message.
Zhang Chen (3):
migration/migration.c: Add missed default error handler for migration
state
migration/migration.c: Avoid COLO boot in postcopy migrationmigration/migration.c: Remove theMIGRATION_STATUS_ACTIVEwhen
migration finishedmigration/migration.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-)--
2.25.1