migration: Synchronize all CPU states only for non-iterable dump
authorPeter Xu <peterx@redhat.com>
Tue, 14 Jan 2025 23:07:36 +0000 (18:07 -0500)
committerFabiano Rosas <farosas@suse.de>
Wed, 29 Jan 2025 14:56:40 +0000 (11:56 -0300)
commit89011a702f29545a0eac74328cd3c2974ecf2699
tree21356d2cbc15386a51ab11ead2adfa46e01732ad
parent48221286937e6453524c6fe96dc6f74368c6fb1c
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>
migration/migration.c
migration/savevm.c