[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 13/16] migration: move calling control_save_page to t
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[Qemu-devel] [PULL 13/16] migration: move calling control_save_page to the common place |
Date: |
Wed, 25 Apr 2018 21:03:23 +0100 |
From: Xiao Guangrong <address@hidden>
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 <address@hidden>
Signed-off-by: Xiao Guangrong <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
---
migration/ram.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/migration/ram.c b/migration/ram.c
index c3628b020e..e0caf7182b 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -1037,10 +1037,6 @@ static int ram_save_page(RAMState *rs, PageSearchStatus
*pss, bool last_stage)
p = block->host + offset;
trace_ram_save_page(block->idstr, (uint64_t)offset, p);
- if (control_save_page(rs, block, offset, &pages)) {
- return pages;
- }
-
XBZRLE_cache_lock();
pages = save_zero_page(rs, block, offset);
if (pages > 0) {
@@ -1198,10 +1194,6 @@ static int ram_save_compressed_page(RAMState *rs,
PageSearchStatus *pss,
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
* the block should be sent out before other pages in the same
* 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,
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
* round of migration even if compression is enabled. In theory,
--
2.17.0
- [Qemu-devel] [PULL 09/16] migration: stop decompression to allocate and free memory frequently, (continued)
- [Qemu-devel] [PULL 09/16] migration: stop decompression to allocate and free memory frequently, Dr. David Alan Gilbert (git), 2018/04/25
- [Qemu-devel] [PULL 06/16] migration: add postcopy total blocktime into query-migrate, Dr. David Alan Gilbert (git), 2018/04/25
- [Qemu-devel] [PULL 15/16] migration: introduce save_normal_page(), Dr. David Alan Gilbert (git), 2018/04/25
- [Qemu-devel] [PULL 14/16] migration: move calling save_zero_page to the common place, Dr. David Alan Gilbert (git), 2018/04/25
- [Qemu-devel] [PULL 03/16] migration: calculate vCPU blocktime on dst side, Dr. David Alan Gilbert (git), 2018/04/25
- [Qemu-devel] [PULL 10/16] migration: detect compression and decompression errors, Dr. David Alan Gilbert (git), 2018/04/25
- [Qemu-devel] [PULL 12/16] migration: move some code to ram_save_host_page, Dr. David Alan Gilbert (git), 2018/04/25
- [Qemu-devel] [PULL 11/16] migration: introduce control_save_page(), Dr. David Alan Gilbert (git), 2018/04/25
- [Qemu-devel] [PULL 13/16] migration: move calling control_save_page to the common place,
Dr. David Alan Gilbert (git) <=
- [Qemu-devel] [PULL 16/16] migration: remove ram_save_compressed_page(), Dr. David Alan Gilbert (git), 2018/04/25
- Re: [Qemu-devel] [PULL 00/16] migration queue, Peter Maydell, 2018/04/26