[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 7/9] block-migration: remove not needed iothread loc
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[Qemu-devel] [PATCH 7/9] block-migration: remove not needed iothread lock |
Date: |
Thu, 11 Dec 2014 17:17:35 +0300 |
Instead of locking iothread, we can just swap these calls. So, if some
write to our range occures before resetting the bitmap, then it will
get into subsequent aio read, becouse it occures, in any case, after
resetting the bitmap.
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
---
block-migration.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/block-migration.c b/block-migration.c
index d0c825f..908a66d 100644
--- a/block-migration.c
+++ b/block-migration.c
@@ -315,13 +315,11 @@ static int mig_save_device_bulk(QEMUFile *f,
BlkMigDevState *bmds)
block_mig_state.submitted++;
blk_mig_unlock();
- qemu_mutex_lock_iothread();
+ bdrv_reset_dirty_bitmap(bs, bmds->dirty_bitmap, cur_sector, nr_sectors);
+
blk->aiocb = bdrv_aio_readv(bs, cur_sector, &blk->qiov,
nr_sectors, blk_mig_read_cb, blk);
- bdrv_reset_dirty_bitmap(bs, bmds->dirty_bitmap, cur_sector, nr_sectors);
- qemu_mutex_unlock_iothread();
-
bmds->cur_sector = cur_sector + nr_sectors;
return (bmds->cur_sector >= total_sectors);
}
--
1.9.1
- [Qemu-devel] [PATCH 0/8] Dirty bitmaps migration, Vladimir Sementsov-Ogievskiy, 2014/12/11
- [Qemu-devel] [PATCH 1/9] block: rename bdrv_reset_dirty_bitmap, Vladimir Sementsov-Ogievskiy, 2014/12/11
- [Qemu-devel] [PATCH 2/9] block-migration: fix pending() return value, Vladimir Sementsov-Ogievskiy, 2014/12/11
- [Qemu-devel] [PATCH 3/9] block: fix spoiling all dirty bitmaps by mirror and migration, Vladimir Sementsov-Ogievskiy, 2014/12/11
- [Qemu-devel] [PATCH 6/9] block-migration: tiny refactoring, Vladimir Sementsov-Ogievskiy, 2014/12/11
- [Qemu-devel] [PATCH 4/9] hbitmap: store / restore, Vladimir Sementsov-Ogievskiy, 2014/12/11
- [Qemu-devel] [PATCH 5/9] block: BdrvDirtyBitmap store/restore interface, Vladimir Sementsov-Ogievskiy, 2014/12/11
- [Qemu-devel] [PATCH 7/9] block-migration: remove not needed iothread lock,
Vladimir Sementsov-Ogievskiy <=
- [Qemu-devel] [PATCH 9/9] block-migration: add named dirty bitmaps migration, Vladimir Sementsov-Ogievskiy, 2014/12/11
- [Qemu-devel] [PATCH 8/9] migration: add dirty parameter, Vladimir Sementsov-Ogievskiy, 2014/12/11