qemu_savevm_state_complete_precopy() iterates SaveStateEntry and does proper tasks for migration.
For each iteration, in_postcopy and iterable_only would be checked to see whether it should skip. Since these two conditions are not SaveStateEntry specific, it is proper to move the check out of iteration. These three patches prepare the code and move the condition check out of the iteration. Wei Yang (3): migration/savevm: flush file for iterable_only case migration/savevm: split qemu_savevm_state_complete_precopy() into two parts migration/savevm: move non SaveStateEntry condition check out of iteration migration/savevm.c | 68 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 50 insertions(+), 18 deletions(-) -- 2.17.1