Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx> --- arch_init.c | 10 +++++++--- arch_init.h | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/arch_init.c b/arch_init.c index d95ce7b..9137013 100644 --- a/arch_init.c +++ b/arch_init.c @@ -416,6 +416,12 @@ static void migration_bitmap_sync(void) static uint64_t bytes_transferred; +void ram_save_set_last_block(RAMBlock *block, ram_addr_t offset) +{ + last_block = block; + last_offset = offset; +} + /* * ram_save_page: Writes a page of memory to the stream f * @@ -496,9 +502,7 @@ bool ram_save_block(QEMUFile *f, bool last_stage) } } while (block != last_block || offset != last_offset); - last_block = block; - last_offset = offset; - + ram_save_set_last_block(block, offset); return wrote; } diff --git a/arch_init.h b/arch_init.h index 499d0f1..9165456 100644 --- a/arch_init.h +++ b/arch_init.h @@ -49,6 +49,7 @@ CpuDefinitionInfoList GCC_WEAK_DECL *arch_query_cpu_definitions(Error **errp); int ram_load_page(QEMUFile *f, void *host, int flags); #if defined(NEED_CPU_H) && !defined(CONFIG_USER_ONLY) +void ram_save_set_last_block(RAMBlock *block, ram_addr_t offset); bool ram_save_page(QEMUFile *f, RAMBlock *block, ram_addr_t offset, bool last_stage); RAMBlock *ram_find_block(const char *id, uint8_t len); -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html