[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 05/14] migration: Drop current address parameter from
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[Qemu-devel] [PULL 05/14] migration: Drop current address parameter from save_zero_page() |
Date: |
Tue, 6 Feb 2018 15:49:27 +0000 |
From: Juan Quintela <address@hidden>
It already has RAMBlock and offset, it can calculate it itself.
Signed-off-by: Juan Quintela <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
---
migration/ram.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/migration/ram.c b/migration/ram.c
index cb1950f3eb..5a109efeda 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -907,11 +907,10 @@ static void migration_bitmap_sync(RAMState *rs)
* @rs: current RAM state
* @block: block that contains the page we want to send
* @offset: offset inside the block for the page
- * @p: pointer to the page
*/
-static int save_zero_page(RAMState *rs, RAMBlock *block, ram_addr_t offset,
- uint8_t *p)
+static int save_zero_page(RAMState *rs, RAMBlock *block, ram_addr_t offset)
{
+ uint8_t *p = block->host + offset;
int pages = -1;
if (is_zero_range(p, TARGET_PAGE_SIZE)) {
@@ -984,7 +983,7 @@ static int ram_save_page(RAMState *rs, PageSearchStatus
*pss, bool last_stage)
}
}
} else {
- pages = save_zero_page(rs, block, offset, p);
+ pages = save_zero_page(rs, block, offset);
if (pages > 0) {
/* Must let xbzrle know, otherwise a previous (now 0'd) cached
* page would be stale
@@ -1160,7 +1159,7 @@ static int ram_save_compressed_page(RAMState *rs,
PageSearchStatus *pss,
*/
if (block != rs->last_sent_block) {
flush_compressed_data(rs);
- pages = save_zero_page(rs, block, offset, p);
+ pages = save_zero_page(rs, block, offset);
if (pages == -1) {
/* Make sure the first page is sent out before other pages */
bytes_xmit = save_page_header(rs, rs->f, block, offset |
@@ -1180,7 +1179,7 @@ static int ram_save_compressed_page(RAMState *rs,
PageSearchStatus *pss,
ram_release_pages(block->idstr, offset, pages);
}
} else {
- pages = save_zero_page(rs, block, offset, p);
+ pages = save_zero_page(rs, block, offset);
if (pages == -1) {
pages = compress_page_with_multi_thread(rs, block, offset);
} else {
--
2.14.3
- [Qemu-devel] [PULL 00/14] migration queue, Dr. David Alan Gilbert (git), 2018/02/06
- [Qemu-devel] [PULL 01/14] migration: Allow migrate_fd_connect to take an Error *, Dr. David Alan Gilbert (git), 2018/02/06
- [Qemu-devel] [PULL 02/14] migration: Route errors down through migration_channel_connect, Dr. David Alan Gilbert (git), 2018/02/06
- [Qemu-devel] [PULL 03/14] migration/savevm.c: set MAX_VM_CMD_PACKAGED_SIZE to 1ul << 32, Dr. David Alan Gilbert (git), 2018/02/06
- [Qemu-devel] [PULL 04/14] migration: use s->threshold_size inside migration_update_counters, Dr. David Alan Gilbert (git), 2018/02/06
- [Qemu-devel] [PULL 05/14] migration: Drop current address parameter from save_zero_page(),
Dr. David Alan Gilbert (git) <=
- [Qemu-devel] [PULL 06/14] tests: Remove deprecated migration tests commands, Dr. David Alan Gilbert (git), 2018/02/06
- [Qemu-devel] [PULL 07/14] tests: Consolidate accelerators declaration, Dr. David Alan Gilbert (git), 2018/02/06
- [Qemu-devel] [PULL 08/14] tests: Use consistent names for migration, Dr. David Alan Gilbert (git), 2018/02/06
- [Qemu-devel] [PULL 09/14] tests: Add deprecated commands migration test, Dr. David Alan Gilbert (git), 2018/02/06
- [Qemu-devel] [PULL 10/14] tests: Create migrate-start-postcopy command, Dr. David Alan Gilbert (git), 2018/02/06
- [Qemu-devel] [PULL 11/14] tests: Adjust sleeps for migration test, Dr. David Alan Gilbert (git), 2018/02/06
- [Qemu-devel] [PULL 12/14] migration: Recover block devices if failure in device state, Dr. David Alan Gilbert (git), 2018/02/06
- [Qemu-devel] [PULL 13/14] migration: Don't leak IO channels, Dr. David Alan Gilbert (git), 2018/02/06
- [Qemu-devel] [PULL 14/14] migration: incoming postcopy advise sanity checks, Dr. David Alan Gilbert (git), 2018/02/06
- Re: [Qemu-devel] [PULL 00/14] migration queue, Peter Maydell, 2018/02/07