migration/postcopy: start_postcopy could be true only when migrate_postcopy() return true
PATCH 1/1 migration/postcopy: start_postcopy could be true only when migrate_postcopy() return true
There is only one place to set start_postcopy to true, qmp_migrate_start_postcopy(), which make sure start_postcopy could be set to true when migrate_postcopy() return true.
So start_postcopy is true implies the other one.
--- migration/migration.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
migration/migration.c +1 -2
@@ -3101,8 +3101,7 @@ static MigIterateState migration_iteration_run(MigrationState *s)if (pending_size && pending_size >= s->threshold_size) {/* Still a significant amount to transfer */ -if (migrate_postcopy () && !in_postcopy && - pend_pre <= s->threshold_size && +if (!in_postcopy && pend_pre <= s->threshold_size &&atomic_read (&s->start_postcopy)) {if (postcopy_start (s)) {error_report ("%s: postcopy failed to start" , __func__);
Signature · 1 line
2.17.1
Quoted 7 lines · * Wei Yang ([email protected]) wrote:
There is only one place to set
start_postcopyto true,qmp_migrate_start_postcopy(), which make surestart_postcopycould be set to true whenmigrate_postcopy()return true.So
start_postcopyis true implies the other one.Signed-off-by Wei Yang <[email protected]>
Quoted 21 lines
--- migration/migration.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)migration/migration.c +1
-2@@ -3101,8 +3101,7 @@ static MigIterateState migration_iteration_run(MigrationState *s)if (pending_size && pending_size >= s->threshold_size) {/* Still a significant amount to transfer */ -if (migrate_postcopy () && !in_postcopy && - pend_pre <= s->threshold_size && +if (!in_postcopy && pend_pre <= s->threshold_size &&atomic_read (&s->start_postcopy)) {if (postcopy_start (s)) {error_report ("%s: postcopy failed to start" , __func__);Signature · 1 line
2.17.1
--
Dr. David Alan Gilbert / [email protected] / Manchester, UK
Quoted 7 lines · * Wei Yang ([email protected]) wrote:
There is only one place to set
start_postcopyto true,qmp_migrate_start_postcopy(), which make surestart_postcopycould be set to true whenmigrate_postcopy()return true.So
start_postcopyis true implies the other one.Signed-off-by Wei Yang <[email protected]>
Queued
Quoted 22 lines
--- migration/migration.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)migration/migration.c +1
-2@@ -3101,8 +3101,7 @@ static MigIterateState migration_iteration_run(MigrationState *s)if (pending_size && pending_size >= s->threshold_size) {/* Still a significant amount to transfer */ -if (migrate_postcopy () && !in_postcopy && - pend_pre <= s->threshold_size && +if (!in_postcopy && pend_pre <= s->threshold_size &&atomic_read (&s->start_postcopy)) {if (postcopy_start (s)) {error_report ("%s: postcopy failed to start" , __func__);Signature · 1 line
2.17.1
--
Dr. David Alan Gilbert / [email protected] / Manchester, UK