aboutsummaryrefslogtreecommitdiff
path: root/migration/block.c
diff options
context:
space:
mode:
authorPeter Lieven <pl@kamp.de>2018-03-08 12:18:25 +0100
committerDr. David Alan Gilbert <dgilbert@redhat.com>2018-03-09 17:39:25 +0000
commit86b124bc76bd7137d0fb20696c4e349571b8533d (patch)
treed386a6b29e0b710375c15db4aabb4365d04c92b4 /migration/block.c
parentb255734531ea2853d1a22b3e64c49084bb304e60 (diff)
downloadqemu-86b124bc76bd7137d0fb20696c4e349571b8533d.zip
qemu-86b124bc76bd7137d0fb20696c4e349571b8533d.tar.gz
qemu-86b124bc76bd7137d0fb20696c4e349571b8533d.tar.bz2
migration/block: reset dirty bitmap before read in bulk phase
Reset the dirty bitmap before reading to make sure we don't miss any new data. Cc: qemu-stable@nongnu.org Signed-off-by: Peter Lieven <pl@kamp.de> Message-Id: <1520507908-16743-3-git-send-email-pl@kamp.de> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'migration/block.c')
-rw-r--r--migration/block.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/migration/block.c b/migration/block.c
index 1f03946..87bb35c 100644
--- a/migration/block.c
+++ b/migration/block.c
@@ -331,11 +331,10 @@ static int mig_save_device_bulk(QEMUFile *f, BlkMigDevState *bmds)
*/
qemu_mutex_lock_iothread();
aio_context_acquire(blk_get_aio_context(bmds->blk));
- blk->aiocb = blk_aio_preadv(bb, cur_sector * BDRV_SECTOR_SIZE, &blk->qiov,
- 0, blk_mig_read_cb, blk);
-
bdrv_reset_dirty_bitmap(bmds->dirty_bitmap, cur_sector * BDRV_SECTOR_SIZE,
nr_sectors * BDRV_SECTOR_SIZE);
+ blk->aiocb = blk_aio_preadv(bb, cur_sector * BDRV_SECTOR_SIZE, &blk->qiov,
+ 0, blk_mig_read_cb, blk);
aio_context_release(blk_get_aio_context(bmds->blk));
qemu_mutex_unlock_iothread();