[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/26] migration: simplify migration_iteration_run()
From: |
Juan Quintela |
Subject: |
[PULL 05/26] migration: simplify migration_iteration_run() |
Date: |
Thu, 2 Feb 2023 17:06:19 +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 594a42f085..cb9aee76c0 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 || 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.39.1
- [PULL 00/26] Next patches, Juan Quintela, 2023/02/02
- [PULL 02/26] migration: No save_live_pending() method uses the QEMUFile parameter, Juan Quintela, 2023/02/02
- [PULL 01/26] migration: Fix migration crash when target psize larger than host, Juan Quintela, 2023/02/02
- [PULL 04/26] migration: Remove unused threshold_size parameter, Juan Quintela, 2023/02/02
- [PULL 07/26] migration/ram: Fix populate_read_range(), Juan Quintela, 2023/02/02
- [PULL 05/26] migration: simplify migration_iteration_run(),
Juan Quintela <=
- [PULL 08/26] migration/ram: Fix error handling in ram_write_tracking_start(), Juan Quintela, 2023/02/02
- [PULL 09/26] migration/ram: Don't explicitly unprotect when unregistering uffd-wp, Juan Quintela, 2023/02/02
- [PULL 10/26] migration/ram: Rely on used_length for uffd_change_protection(), Juan Quintela, 2023/02/02
- [PULL 12/26] migration/savevm: Move more savevm handling into vmstate_save(), Juan Quintela, 2023/02/02
- [PULL 13/26] migration/savevm: Prepare vmdesc json writer in qemu_savevm_state_setup(), Juan Quintela, 2023/02/02
- [PULL 14/26] migration/savevm: Allow immutable device state to be migrated early (i.e., before RAM), Juan Quintela, 2023/02/02
- [PULL 16/26] migration/ram: Factor out check for advised postcopy, Juan Quintela, 2023/02/02
- [PULL 17/26] virtio-mem: Fail if a memory backend with "prealloc=on" is specified, Juan Quintela, 2023/02/02
- [PULL 06/26] util/userfaultfd: Add uffd_open(), Juan Quintela, 2023/02/02
- [PULL 03/26] migration: Split save_live_pending() into state_pending_*, Juan Quintela, 2023/02/02