savevm: split the process of different stages for loadvm/savevm
commit3f6df99d9dc8ce33deae1835e96e659063fa3037
authorZhang Chen <zhangckid@gmail.com>
Mon, 3 Sep 2018 04:38:54 +0000 (3 12:38 +0800)
committerJason Wang <jasowang@redhat.com>
Fri, 19 Oct 2018 03:15:03 +0000 (19 11:15 +0800)
tree578f2bbbc083d669a10b5ce4dd77f4952d19b0b8
parentf56c0065b8dd65489621bb7ca1a94d8004d68da1
savevm: split the process of different stages for loadvm/savevm

There are several stages during loadvm/savevm process. In different stage,
migration incoming processes different types of sections.
We want to control these stages more accuracy, it will benefit COLO
performance, we don't have to save type of QEMU_VM_SECTION_START
sections everytime while do checkpoint, besides, we want to separate
the process of saving/loading memory and devices state.

So we add three new helper functions: qemu_load_device_state() and
qemu_savevm_live_state() to achieve different process during migration.

Besides, we make qemu_loadvm_state_main() and qemu_save_device_state()
public, and simplify the codes of qemu_save_device_state() by calling the
wrapper qemu_savevm_state_header().

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
Signed-off-by: Zhang Chen <zhangckid@gmail.com>
Signed-off-by: Zhang Chen <chen.zhang@intel.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
migration/colo.c
migration/savevm.c
migration/savevm.h