aboutsummaryrefslogtreecommitdiff
path: root/migration
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2022-10-03 02:54:57 +0200
committerJuan Quintela <quintela@redhat.com>2023-02-06 19:22:56 +0100
commitd9df92925ef2b7ca8774ef44b0e1f859a91d4cd6 (patch)
treedb9013e5d3df114054e7106f7f6357790d074a1f /migration
parentfd70385d38bb75128c1bdfc027af81cc41ec0e48 (diff)
downloadqemu-d9df92925ef2b7ca8774ef44b0e1f859a91d4cd6.zip
qemu-d9df92925ef2b7ca8774ef44b0e1f859a91d4cd6.tar.gz
qemu-d9df92925ef2b7ca8774ef44b0e1f859a91d4cd6.tar.bz2
migration: simplify migration_iteration_run()
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'migration')
-rw-r--r--migration/migration.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/migration/migration.c b/migration/migration.c
index 7cab4b8..6d4cd80 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -3794,23 +3794,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 || 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;
}