migration: fix the Unknown ending state error log
PATCH 1/2 migration: fix the Unknown ending state error log
When cancelling migration, the state is MIGRATION_STATUS_CANCELLING. The state change to MIGRATION_STATUS_CANCELLED when cleanup_bh is scheduled. So when migration_iteration_finish is invoked, the state should be MIGRATION_STATUS_CANCELLING.
--- migration/migration.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
migration/migration.c +1 -1
@@ -2876,7 +2876,7 @@ static void migration_iteration_finish(MigrationState *s) s->vm_was_running = true;/* Fallthrough */ case MIGRATION_STATUS_FAILED : -case MIGRATION_STATUS_CANCELLED : +case MIGRATION_STATUS_CANCELLING :if (s->vm_was_running) {vm_start (); }else {
Signature · 1 line
1.8.3.1
PATCH 2/2 migration: fix duplicate initialization for expected_downtime and cleanup_bh
migrate_fd_connect duplicate initialize expected_downtime and cleanup_bh.
--- migration/migration.c | 2 -- 1 file changed, 2 deletions(-)
migration/migration.c +0 -2
@@ -3032,8 +3032,6 @@ void migrate_fd_connect(MigrationState *s, Error *error_in) }else {/* This is a fresh new migration */ rate_limit = s->parameters.max_bandwidth /XFER_LIMIT_RATIO ; - s->expected_downtime = s->parameters.downtime_limit; - s->cleanup_bh =qemu_bh_new (migrate_fd_cleanup, s);/* Notify before starting migration thread */ notifier_list_notify (&migration_state_notifiers, s);
Signature · 1 line
1.8.3.1
Re: [Qemu-devel] [PATCH 2/2] migration: fix duplicate initialization for expected_downtime and cleanup_bh
Quoted 3 lines · Lidong Chen
migrate_fd_connectduplicate initializeexpected_downtimeandcleanup_bh.Signed-off-by Lidong Chen <[email protected]>
This seems correct to me.
Quoted 21 lines
--- migration/migration.c | 2 -- 1 file changed, 2 deletions(-)migration/migration.c +0
-2@@ -3032,8 +3032,6 @@ void migrate_fd_connect(MigrationState *s, Error *error_in) }else {/* This is a fresh new migration */ rate_limit = s->parameters.max_bandwidth /XFER_LIMIT_RATIO ; - s->expected_downtime = s->parameters.downtime_limit; - s->cleanup_bh =qemu_bh_new (migrate_fd_cleanup, s);/* Notify before starting migration thread */ notifier_list_notify (&migration_state_notifiers, s);Signature · 1 line
1.8.3.1
Regards,
Signature · 1 line
Peter Xu
Re: [Qemu-devel] [PATCH 2/2] migration: fix duplicate initialization for expected_downtime and cleanup_bh
In reply to Lidong ChenQuoted 3 lines · Lidong Chen
migrate_fd_connectduplicate initializeexpected_downtimeandcleanup_bh.Signed-off-by Lidong Chen <[email protected]>
Good catch.
Inserted here.
commit d3e35b8f6248eab2c3d412198a487ae49706b214
Author: Peter Xu <[email protected]> Date: Wed May 2 18:47:24 2018 +0800
Quoted 17 lines
--- migration/migration.c | 2 -- 1 file changed, 2 deletions(-)migration/migration.c +0
-2@@ -3032,8 +3032,6 @@ void migrate_fd_connect(MigrationState *s, Error *error_in) }else {/* This is a fresh new migration */ rate_limit = s->parameters.max_bandwidth /XFER_LIMIT_RATIO ; - s->expected_downtime = s->parameters.downtime_limit; - s->cleanup_bh =qemu_bh_new (migrate_fd_cleanup, s);/* Notify before starting migration thread */ notifier_list_notify (&migration_state_notifiers, s);
Re: [Qemu-devel] [PATCH 2/2] migration: fix duplicate initialization for expected_downtime and cleanup_bh
In reply to Lidong ChenQuoted 1 line · * Lidong Chen ([email protected]) wrote:
migrate_fd_connectduplicate initializeexpected_downtimeandcleanup_bh.
Queued (just 2/2)
Quoted 22 lines
Signed-off-by Lidong Chen <[email protected]>--- migration/migration.c | 2 -- 1 file changed, 2 deletions(-)migration/migration.c +0
-2@@ -3032,8 +3032,6 @@ void migrate_fd_connect(MigrationState *s, Error *error_in) }else {/* This is a fresh new migration */ rate_limit = s->parameters.max_bandwidth /XFER_LIMIT_RATIO ; - s->expected_downtime = s->parameters.downtime_limit; - s->cleanup_bh =qemu_bh_new (migrate_fd_cleanup, s);/* Notify before starting migration thread */ notifier_list_notify (&migration_state_notifiers, s);Signature · 1 line
1.8.3.1
--
Dr. David Alan Gilbert / [email protected] / Manchester, UK
Quoted 6 lines · Lidong Chen
When cancelling migration, the state is
MIGRATION_STATUS_CANCELLING. The state change toMIGRATION_STATUS_CANCELLEDwhencleanup_bhis scheduled. So whenmigration_iteration_finishis invoked, the state should beMIGRATION_STATUS_CANCELLING.Signed-off-by Lidong Chen <[email protected]>
Thanks, Lidong. Dave just posted the same patch some days ago:
[PATCH] migrate: Fix cancelling state warning
Quoted 21 lines
--- migration/migration.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)migration/migration.c +1
-1@@ -2876,7 +2876,7 @@ static void migration_iteration_finish(MigrationState *s) s->vm_was_running = true;/* Fallthrough */ case MIGRATION_STATUS_FAILED : -case MIGRATION_STATUS_CANCELLED : +case MIGRATION_STATUS_CANCELLING :if (s->vm_was_running) {vm_start (); }else {Signature · 1 line
1.8.3.1
Regards,
Signature · 1 line
Peter Xu