提交 5a170775 编写于 作者: J Juan Quintela

savevm: Factorize ram globals reset in its own function

Signed-off-by: NJuan Quintela <quintela@redhat.com>
Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
Reviewed-by: NOrit Wasserman <owasserm@redhat.com>
上级 2c52ddf1
......@@ -481,6 +481,14 @@ static void ram_migration_cancel(void *opaque)
migration_end();
}
static void reset_ram_globals(void)
{
last_block = NULL;
last_offset = 0;
sort_ram_list();
}
#define MAX_WAIT 50 /* ms, half buffered_file limit */
static int ram_save_setup(QEMUFile *f, void *opaque)
......@@ -489,9 +497,7 @@ static int ram_save_setup(QEMUFile *f, void *opaque)
RAMBlock *block;
bytes_transferred = 0;
last_block = NULL;
last_offset = 0;
sort_ram_list();
reset_ram_globals();
if (migrate_use_xbzrle()) {
XBZRLE.cache = cache_init(migrate_xbzrle_cache_size() /
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册