aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Lieven <pl@kamp.de>2018-03-08 12:18:25 +0100
committerMichael Roth <mdroth@linux.vnet.ibm.com>2018-06-20 20:44:59 -0500
commitab2dfe8d17c3f0c5788c4d52d1265eb6bcb65550 (patch)
treebe5040a402a7b2c8bf6792f76482e9ebd630543f
parentcebb7fea7cf10b347b8a76448788779ad32e63f8 (diff)
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> (cherry picked from commit 86b124bc76bd7137d0fb20696c4e349571b8533d) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r--migration/block.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/migration/block.c b/migration/block.c
index 7147171bb7..7dc13352d8 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();