mirror of
https://github.com/qemu/qemu.git
synced 2025-01-22 21:44:07 +08:00
migration: move calling control_save_page to the common place
The function is called by both ram_save_page and ram_save_target_page, so move it to the common caller to cleanup the code Reviewed-by: Peter Xu <peterx@redhat.com> Signed-off-by: Xiao Guangrong <xiaoguangrong@tencent.com> Message-Id: <20180330075128.26919-8-xiaoguangrong@tencent.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
This commit is contained in:
parent
1faa5665c0
commit
a8ec91f941
@ -1037,10 +1037,6 @@ static int ram_save_page(RAMState *rs, PageSearchStatus *pss, bool last_stage)
|
|||||||
p = block->host + offset;
|
p = block->host + offset;
|
||||||
trace_ram_save_page(block->idstr, (uint64_t)offset, p);
|
trace_ram_save_page(block->idstr, (uint64_t)offset, p);
|
||||||
|
|
||||||
if (control_save_page(rs, block, offset, &pages)) {
|
|
||||||
return pages;
|
|
||||||
}
|
|
||||||
|
|
||||||
XBZRLE_cache_lock();
|
XBZRLE_cache_lock();
|
||||||
pages = save_zero_page(rs, block, offset);
|
pages = save_zero_page(rs, block, offset);
|
||||||
if (pages > 0) {
|
if (pages > 0) {
|
||||||
@ -1198,10 +1194,6 @@ static int ram_save_compressed_page(RAMState *rs, PageSearchStatus *pss,
|
|||||||
|
|
||||||
p = block->host + offset;
|
p = block->host + offset;
|
||||||
|
|
||||||
if (control_save_page(rs, block, offset, &pages)) {
|
|
||||||
return pages;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* When starting the process of a new block, the first page of
|
/* When starting the process of a new block, the first page of
|
||||||
* the block should be sent out before other pages in the same
|
* the block should be sent out before other pages in the same
|
||||||
* block, and all the pages in last block should have been sent
|
* block, and all the pages in last block should have been sent
|
||||||
@ -1489,6 +1481,14 @@ err:
|
|||||||
static int ram_save_target_page(RAMState *rs, PageSearchStatus *pss,
|
static int ram_save_target_page(RAMState *rs, PageSearchStatus *pss,
|
||||||
bool last_stage)
|
bool last_stage)
|
||||||
{
|
{
|
||||||
|
RAMBlock *block = pss->block;
|
||||||
|
ram_addr_t offset = pss->page << TARGET_PAGE_BITS;
|
||||||
|
int res;
|
||||||
|
|
||||||
|
if (control_save_page(rs, block, offset, &res)) {
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If xbzrle is on, stop using the data compression after first
|
* If xbzrle is on, stop using the data compression after first
|
||||||
* round of migration even if compression is enabled. In theory,
|
* round of migration even if compression is enabled. In theory,
|
||||||
|
Loading…
Reference in New Issue
Block a user