summary refs log tree commit diff stats
path: root/migration/migration.c
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2025-01-14 18:07:36 -0500
committerFabiano Rosas <farosas@suse.de>2025-01-29 11:56:40 -0300
commit89011a702f29545a0eac74328cd3c2974ecf2699 (patch)
tree21356d2cbc15386a51ab11ead2adfa46e01732ad /migration/migration.c
parent48221286937e6453524c6fe96dc6f74368c6fb1c (diff)
downloadfocaccia-qemu-89011a702f29545a0eac74328cd3c2974ecf2699.tar.gz
focaccia-qemu-89011a702f29545a0eac74328cd3c2974ecf2699.zip
migration: Synchronize all CPU states only for non-iterable dump
Do one shot cpu sync at qemu_savevm_state_complete_precopy_non_iterable(),
instead of coding it separately in two places.

Note that in the context of qemu_savevm_state_complete_precopy(), this
patch is also an optimization for postcopy path, in that we can avoid sync
cpu twice during switchover: before this patch, postcopy_start() invokes
twice on qemu_savevm_state_complete_precopy(), each of them will try to
sync CPU info.  In reality, only one of them would be enough.

For background snapshot, there's no intended functional change.

Signed-off-by: Peter Xu <peterx@redhat.com>
Tested-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Juraj Marcin <jmarcin@redhat.com>
Link: https://lore.kernel.org/r/20250114230746.3268797-7-peterx@redhat.com
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Diffstat (limited to 'migration/migration.c')
-rw-r--r--migration/migration.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/migration/migration.c b/migration/migration.c
index d8a6bc12e0..46e30a4814 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -3749,11 +3749,7 @@ static void *bg_migration_thread(void *opaque)
     if (migration_stop_vm(s, RUN_STATE_PAUSED)) {
         goto fail;
     }
-    /*
-     * Put vCPUs in sync with shadow context structures, then
-     * save their state to channel-buffer along with devices.
-     */
-    cpu_synchronize_all_states();
+
     if (qemu_savevm_state_complete_precopy_non_iterable(fb, false)) {
         goto fail;
     }