migration: simplify migration_iteration_run()

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
This commit is contained in:
Juan Quintela 2022-10-03 02:54:57 +02:00
parent fd70385d38
commit d9df92925e
1 changed files with 12 additions and 12 deletions

View File

@ -3794,7 +3794,12 @@ static MigIterateState migration_iteration_run(MigrationState *s)
pend_pre, pend_compat, pend_post);
}
if (pending_size && pending_size >= s->threshold_size) {
if (!pending_size || pending_size < s->threshold_size) {
trace_migration_thread_low_pending(pending_size);
migration_completion(s);
return MIG_ITERATE_BREAK;
}
/* Still a significant amount to transfer */
if (!in_postcopy && pend_pre <= s->threshold_size &&
qatomic_read(&s->start_postcopy)) {
@ -3803,14 +3808,9 @@ static MigIterateState migration_iteration_run(MigrationState *s)
}
return MIG_ITERATE_SKIP;
}
/* Just another iteration step */
qemu_savevm_state_iterate(s->to_dst_file, in_postcopy);
} else {
trace_migration_thread_low_pending(pending_size);
migration_completion(s);
return MIG_ITERATE_BREAK;
}
return MIG_ITERATE_RESUME;
}