[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 33/38] migration/ram: Stop passing QEMUFile around in save_zero_pa
From: |
Juan Quintela |
Subject: |
[PULL 33/38] migration/ram: Stop passing QEMUFile around in save_zero_page |
Date: |
Tue, 17 Oct 2023 10:29:58 +0200 |
From: Fabiano Rosas <farosas@suse.de>
We don't need the QEMUFile when we're already passing the
PageSearchStatus.
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231011184604.32364-5-farosas@suse.de>
---
migration/ram.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/migration/ram.c b/migration/ram.c
index 535172d9be..2ec28c4507 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -1147,10 +1147,11 @@ void ram_release_page(const char *rbname, uint64_t
offset)
* @block: block that contains the page we want to send
* @offset: offset inside the block for the page
*/
-static int save_zero_page_to_file(PageSearchStatus *pss, QEMUFile *file,
- RAMBlock *block, ram_addr_t offset)
+static int save_zero_page_to_file(PageSearchStatus *pss, RAMBlock *block,
+ ram_addr_t offset)
{
uint8_t *p = block->host + offset;
+ QEMUFile *file = pss->pss_channel;
int len = 0;
if (buffer_is_zero(p, TARGET_PAGE_SIZE)) {
@@ -1171,10 +1172,10 @@ static int save_zero_page_to_file(PageSearchStatus
*pss, QEMUFile *file,
* @block: block that contains the page we want to send
* @offset: offset inside the block for the page
*/
-static int save_zero_page(PageSearchStatus *pss, QEMUFile *f, RAMBlock *block,
+static int save_zero_page(PageSearchStatus *pss, RAMBlock *block,
ram_addr_t offset)
{
- int len = save_zero_page_to_file(pss, f, block, offset);
+ int len = save_zero_page_to_file(pss, block, offset);
if (len) {
stat64_add(&mig_stats.zero_pages, 1);
@@ -2138,7 +2139,7 @@ static int ram_save_target_page_legacy(RAMState *rs,
PageSearchStatus *pss)
return 1;
}
- res = save_zero_page(pss, pss->pss_channel, block, offset);
+ res = save_zero_page(pss, block, offset);
if (res > 0) {
/* Must let xbzrle know, otherwise a previous (now 0'd) cached
* page would be stale
--
2.41.0
- [PULL 10/38] tests/qtest/migration: Add a test for the analyze-migration script, (continued)
- [PULL 10/38] tests/qtest/migration: Add a test for the analyze-migration script, Juan Quintela, 2023/10/17
- [PULL 28/38] migration: check for rate_limit_max for RATE_LIMIT_DISABLED, Juan Quintela, 2023/10/17
- [PULL 16/38] migration/rdma: Unfold ram_control_after_iterate(), Juan Quintela, 2023/10/17
- [PULL 18/38] migration/rdma: Unfold hook_ram_load(), Juan Quintela, 2023/10/17
- [PULL 19/38] migration/rdma: Create rdma_control_save_page(), Juan Quintela, 2023/10/17
- [PULL 25/38] migration/rdma: Declare for index variables local, Juan Quintela, 2023/10/17
- [PULL 21/38] migration/rdma: Move rdma constants from qemu-file.h to rdma.h, Juan Quintela, 2023/10/17
- [PULL 29/38] multifd: fix counters in multifd_send_thread, Juan Quintela, 2023/10/17
- [PULL 32/38] migration/ram: Remove RAMState from xbzrle_cache_zero_page, Juan Quintela, 2023/10/17
- [PULL 31/38] migration/ram: Refactor precopy ram loading code, Juan Quintela, 2023/10/17
- [PULL 33/38] migration/ram: Stop passing QEMUFile around in save_zero_page,
Juan Quintela <=
- [PULL 34/38] migration/ram: Move xbzrle zero page handling into save_zero_page, Juan Quintela, 2023/10/17
- [PULL 35/38] migration/ram: Merge save_zero_page functions, Juan Quintela, 2023/10/17
- [PULL 36/38] migration/multifd: Remove direct "socket" references, Juan Quintela, 2023/10/17
- [PULL 30/38] multifd: reset next_packet_len after sending pages, Juan Quintela, 2023/10/17
- [PULL 37/38] migration/multifd: Unify multifd_send_thread error paths, Juan Quintela, 2023/10/17
- [PULL 38/38] migration/multifd: Clarify Error usage in multifd_channel_connect, Juan Quintela, 2023/10/17
- Re: [PULL 00/38] Migration 20231017 patches, Stefan Hajnoczi, 2023/10/17