[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 11/11] migration: save_zero_page() can take block through pss
|
From: |
Juan Quintela |
|
Subject: |
[PULL 11/11] migration: save_zero_page() can take block through pss |
|
Date: |
Wed, 18 Oct 2023 12:06:51 +0200 |
Reviewed-by: Lukas Straub <lukasstraub2@web.de>
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
migration/ram.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/migration/ram.c b/migration/ram.c
index 7f18c1808d..16c30a9d7a 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -1144,13 +1144,12 @@ void ram_release_page(const char *rbname, uint64_t
offset)
*
* @rs: current RAM state
* @pss: current PSS channel
- * @block: block that contains the page we want to send
* @offset: offset inside the block for the page
*/
-static int save_zero_page(RAMState *rs, PageSearchStatus *pss, RAMBlock *block,
+static int save_zero_page(RAMState *rs, PageSearchStatus *pss,
ram_addr_t offset)
{
- uint8_t *p = block->host + offset;
+ uint8_t *p = pss->block->host + offset;
QEMUFile *file = pss->pss_channel;
int len = 0;
@@ -1158,10 +1157,10 @@ static int save_zero_page(RAMState *rs,
PageSearchStatus *pss, RAMBlock *block,
return 0;
}
- len += save_page_header(pss, file, block, offset | RAM_SAVE_FLAG_ZERO);
+ len += save_page_header(pss, file, pss->block, offset |
RAM_SAVE_FLAG_ZERO);
qemu_put_byte(file, 0);
len += 1;
- ram_release_page(block->idstr, offset);
+ ram_release_page(pss->block->idstr, offset);
stat64_add(&mig_stats.zero_pages, 1);
ram_transferred_add(len);
@@ -1172,7 +1171,7 @@ static int save_zero_page(RAMState *rs, PageSearchStatus
*pss, RAMBlock *block,
*/
if (rs->xbzrle_started) {
XBZRLE_cache_lock();
- xbzrle_cache_zero_page(block->offset + offset);
+ xbzrle_cache_zero_page(pss->block->offset + offset);
XBZRLE_cache_unlock();
}
@@ -2119,7 +2118,7 @@ static int ram_save_target_page_legacy(RAMState *rs,
PageSearchStatus *pss)
return 1;
}
- if (save_zero_page(rs, pss, block, offset)) {
+ if (save_zero_page(rs, pss, offset)) {
return 1;
}
--
2.41.0
- [PULL 00/11] Migration 20231018 patches, Juan Quintela, 2023/10/18
- [PULL 02/11] migration: Move compression_counters cleanup ram-compress.c, Juan Quintela, 2023/10/18
- [PULL 01/11] migration: RDMA is not compatible with anything else, Juan Quintela, 2023/10/18
- [PULL 04/11] migration: Create ram_compressed_pages(), Juan Quintela, 2023/10/18
- [PULL 07/11] migration: Use "i" as an for index in ram-compress.c, Juan Quintela, 2023/10/18
- [PULL 11/11] migration: save_zero_page() can take block through pss,
Juan Quintela <=
- [PULL 09/11] migration: save_compress_page() can take block through pss, Juan Quintela, 2023/10/18
- [PULL 05/11] migration: Move update_compress_threads_counts() to ram-compress.c, Juan Quintela, 2023/10/18
- [PULL 10/11] migration: control_save_page() can take block through pss, Juan Quintela, 2023/10/18
- [PULL 06/11] migration: Simplify decompress_data_with_multi_threads(), Juan Quintela, 2023/10/18
- [PULL 08/11] migration: Print block status when needed, Juan Quintela, 2023/10/18
- [PULL 03/11] migration: Create populate_compress(), Juan Quintela, 2023/10/18
- Re: [PULL 00/11] Migration 20231018 patches, Stefan Hajnoczi, 2023/10/20