On 30.01.23 11:03, Juan Quintela wrote:
Signed-off-by: Juan Quintela <[email protected]> Reviewed-by: Dr. David Alan Gilbert <[email protected]> --- migration/migration.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)diff --git a/migration/migration.c b/migration/migration.c index 594a42f085..644c61e91d 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -3764,23 +3764,23 @@ static MigIterateState migration_iteration_run(MigrationState *s) pend_pre, pend_compat, pend_post); }- if (pending_size && pending_size >= s->threshold_size) {- /* Still a significant amount to transfer */ - if (!in_postcopy && pend_pre <= s->threshold_size && - qatomic_read(&s->start_postcopy)) { - if (postcopy_start(s)) { - error_report("%s: postcopy failed to start", __func__); - } - return MIG_ITERATE_SKIP; - } - /* Just another iteration step */ - qemu_savevm_state_iterate(s->to_dst_file, in_postcopy); - } else { + if (pending_size < s->threshold_size) {
to keep the logic, formally it should be "if (!pending_size || pending_size < s->threshold_size)"... Actually, could s->threshold_size be 0 here? Or, worth an assertion assert(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)) { + if (postcopy_start(s)) { + error_report("%s: postcopy failed to start", __func__); + } + return MIG_ITERATE_SKIP; + } + + /* Just another iteration step */ + qemu_savevm_state_iterate(s->to_dst_file, in_postcopy); return MIG_ITERATE_RESUME; }
-- Best regards, Vladimir
