diff --git a/block-migration.c b/block-migration.c index 16562709c8..25a03889f4 100644 --- a/block-migration.c +++ b/block-migration.c @@ -629,6 +629,7 @@ static int block_save_setup(QEMUFile *f, void *opaque) block_mig_state.submitted, block_mig_state.transferred); qemu_mutex_lock_iothread(); + init_blk_migration(f); /* start track dirty blocks */ ret = set_dirty_tracking(); @@ -638,8 +639,6 @@ static int block_save_setup(QEMUFile *f, void *opaque) return ret; } - init_blk_migration(f); - qemu_mutex_unlock_iothread(); ret = flush_blks(f);