[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 51/51] migration: simplify migration_iteration_run()
From: |
Juan Quintela |
Subject: |
[PATCH v2 51/51] migration: simplify migration_iteration_run() |
Date: |
Mon, 5 Dec 2022 10:52:28 +0100 |
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
migration/migration.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/migration/migration.c b/migration/migration.c
index b54e4657ce..b2c974f166 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -3769,23 +3769,23 @@ static MigIterateState
migration_iteration_run(MigrationState *s)
trace_migrate_pending_exact(pending_size, s->threshold_size, pend_pre,
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) {
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;
}
--
2.38.1
- [PATCH v2 40/51] migration: Introduce pss_channel, (continued)
- [PATCH v2 40/51] migration: Introduce pss_channel, Juan Quintela, 2022/12/05
- [PATCH v2 41/51] migration: Add pss_init(), Juan Quintela, 2022/12/05
- [PATCH v2 42/51] migration: Make PageSearchStatus part of RAMState, Juan Quintela, 2022/12/05
- [PATCH v2 43/51] migration: Move last_sent_block into PageSearchStatus, Juan Quintela, 2022/12/05
- [PATCH v2 44/51] migration: Send requested page directly in rp-return thread, Juan Quintela, 2022/12/05
- [PATCH v2 45/51] migration: Remove old preempt code around state maintainance, Juan Quintela, 2022/12/05
- [PATCH v2 46/51] migration: Drop rs->f, Juan Quintela, 2022/12/05
- [PATCH v2 47/51] migration: Remove res_compatible parameter, Juan Quintela, 2022/12/05
- [PATCH v2 48/51] migration: No save_live_pending() method uses the QEMUFile parameter, Juan Quintela, 2022/12/05
- [PATCH v2 50/51] migration: Remove unused threshold_size parameter, Juan Quintela, 2022/12/05
- [PATCH v2 51/51] migration: simplify migration_iteration_run(),
Juan Quintela <=
- [PATCH v2 49/51] migration: Split save_live_pending() into state_pending_*, Juan Quintela, 2022/12/05