[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 03/14] migration: Simplify migration_iteration_run()
From: |
Avihai Horon |
Subject: |
[PATCH v5 03/14] migration: Simplify migration_iteration_run() |
Date: |
Thu, 29 Dec 2022 13:03:34 +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 9795d0ec5c..61b9ce0fe8 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -3758,23 +3758,24 @@ static MigIterateState
migration_iteration_run(MigrationState *s)
trace_migrate_pending(pending_size, s->threshold_size,
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.26.3
- [PATCH v5 00/14] vfio/migration: Implement VFIO migration protocol v2, Avihai Horon, 2022/12/29
- [PATCH v5 01/14] linux-headers: Update to v6.2-rc1, Avihai Horon, 2022/12/29
- [PATCH v5 02/14] migration: No save_live_pending() method uses the QEMUFile parameter, Avihai Horon, 2022/12/29
- [PATCH v5 03/14] migration: Simplify migration_iteration_run(),
Avihai Horon <=
- [PATCH v5 04/14] vfio/migration: Fix NULL pointer dereference bug, Avihai Horon, 2022/12/29
- [PATCH v5 05/14] vfio/migration: Allow migration without VFIO IOMMU dirty tracking support, Avihai Horon, 2022/12/29
- [PATCH v5 07/14] vfio/common: Change vfio_devices_all_running_and_saving() logic to equivalent one, Avihai Horon, 2022/12/29
- [PATCH v5 06/14] migration/qemu-file: Add qemu_file_get_to_fd(), Avihai Horon, 2022/12/29
- [PATCH v5 08/14] vfio/migration: Move migration v1 logic to vfio_migration_init(), Avihai Horon, 2022/12/29
- [PATCH v5 09/14] vfio/migration: Rename functions/structs related to v1 protocol, Avihai Horon, 2022/12/29
- [PATCH v5 10/14] vfio/migration: Implement VFIO migration protocol v2, Avihai Horon, 2022/12/29
- [PATCH v5 13/14] vfio: Alphabetize migration section of VFIO trace-events file, Avihai Horon, 2022/12/29
- [PATCH v5 12/14] vfio/migration: Remove VFIO migration protocol v1, Avihai Horon, 2022/12/29
- [PATCH v5 14/14] docs/devel: Align VFIO migration docs to v2 protocol, Avihai Horon, 2022/12/29