[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC 6/7] migration: simplify migration_iteration_run()
From: |
Juan Quintela |
Subject: |
[RFC 6/7] migration: simplify migration_iteration_run() |
Date: |
Mon, 3 Oct 2022 05:15:59 +0200 |
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
migration/migration.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/migration/migration.c b/migration/migration.c
index 97fefd579e..35e512887a 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -3747,23 +3747,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.37.2
- [RFC 0/7] migration patches for VFIO, Juan Quintela, 2022/10/02
- [RFC 1/7] migration: Remove res_compatible parameter, Juan Quintela, 2022/10/02
- [RFC 3/7] migration: Block migration comment or code is wrong, Juan Quintela, 2022/10/02
- [RFC 4/7] migration: Split save_live_pending() into state_pending_*, Juan Quintela, 2022/10/02
- [RFC 2/7] migration: No save_live_pending() method uses the QEMUFile parameter, Juan Quintela, 2022/10/02
- [RFC 5/7] migration: Remove unused threshold_size parameter, Juan Quintela, 2022/10/02
- [RFC 6/7] migration: simplify migration_iteration_run(),
Juan Quintela <=
- [RFC 7/7] migration: call qemu_savevm_state_pending_exact() with the guest stopped, Juan Quintela, 2022/10/02
- Re: [RFC 7/7] migration: call qemu_savevm_state_pending_exact() with the guest stopped, Joao Martins, 2022/10/13
- Re: [RFC 7/7] migration: call qemu_savevm_state_pending_exact() with the guest stopped, Juan Quintela, 2022/10/13
- Re: [RFC 7/7] migration: call qemu_savevm_state_pending_exact() with the guest stopped, Joao Martins, 2022/10/14
- Re: [RFC 7/7] migration: call qemu_savevm_state_pending_exact() with the guest stopped, Juan Quintela, 2022/10/14
- Re: [RFC 7/7] migration: call qemu_savevm_state_pending_exact() with the guest stopped, Joao Martins, 2022/10/14
- Re: [RFC 7/7] migration: call qemu_savevm_state_pending_exact() with the guest stopped, Jason Gunthorpe, 2022/10/18
- RE: [RFC 7/7] migration: call qemu_savevm_state_pending_exact() with the guest stopped, Yishai Hadas, 2022/10/19
- Re: [RFC 7/7] migration: call qemu_savevm_state_pending_exact() with the guest stopped, Jason Gunthorpe, 2022/10/15
RE: [RFC 0/7] migration patches for VFIO, Yishai Hadas, 2022/10/20