summaryrefslogtreecommitdiff
path: root/migration/block.c
diff options
context:
space:
mode:
Diffstat (limited to 'migration/block.c')
-rw-r--r--migration/block.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/migration/block.c b/migration/block.c
index 9e2092681e..423877bb40 100644
--- a/migration/block.c
+++ b/migration/block.c
@@ -532,6 +532,8 @@ static int mig_save_device_dirty(QEMUFile *f, BlkMigDevState *bmds,
} else {
nr_sectors = BDRV_SECTORS_PER_DIRTY_CHUNK;
}
+ bdrv_reset_dirty_bitmap(bmds->dirty_bitmap, sector, nr_sectors);
+
blk = g_new(BlkMigBlock, 1);
blk->buf = g_malloc(BLOCK_SIZE);
blk->bmds = bmds;
@@ -564,7 +566,6 @@ static int mig_save_device_dirty(QEMUFile *f, BlkMigDevState *bmds,
g_free(blk);
}
- bdrv_reset_dirty_bitmap(bmds->dirty_bitmap, sector, nr_sectors);
sector += nr_sectors;
bmds->cur_dirty = sector;