[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 04/17] migration: Simplify migration_iteration_run()
From: |
Avihai Horon |
Subject: |
[PATCH v3 04/17] migration: Simplify migration_iteration_run() |
Date: |
Thu, 3 Nov 2022 18:16:07 +0200 |
From: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Avihai Horon <avihaih@nvidia.com>
---
migration/migration.c | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
diff --git a/migration/migration.c b/migration/migration.c
index ffe868b86f..59cc3c309b 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -3743,23 +3743,24 @@ static MigIterateState
migration_iteration_run(MigrationState *s)
trace_migrate_pending(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.21.3
- Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2, (continued)
- Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2, Alex Williamson, 2022/11/28
- Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2, Jason Gunthorpe, 2022/11/28
- Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2, Alex Williamson, 2022/11/28
- Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2, Jason Gunthorpe, 2022/11/28
- Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2, Alex Williamson, 2022/11/28
- Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2, Avihai Horon, 2022/11/29
Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2, Dr. David Alan Gilbert, 2022/11/23
[PATCH v3 04/17] migration: Simplify migration_iteration_run(),
Avihai Horon <=