@@ -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;
}
@@ -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);
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> --- arch_init.c | 10 +++++++--- arch_init.h | 1 + 2 files changed, 8 insertions(+), 3 deletions(-)