[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 03/13] blockdev: Lock BDS during internal snapsho
From: |
Fam Zheng |
Subject: |
[Qemu-devel] [PATCH v2 03/13] blockdev: Lock BDS during internal snapshot transaction |
Date: |
Tue, 2 Jun 2015 11:21:52 +0800 |
Signed-off-by: Fam Zheng <address@hidden>
---
blockdev.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/blockdev.c b/blockdev.c
index 5eaf77e..fdc5a17 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -1356,6 +1356,7 @@ static void internal_snapshot_prepare(BlkTransactionState
*common,
}
/* 4. succeed, mark a snapshot is created */
+ bdrv_lock(bs);
state->bs = bs;
}
@@ -1387,6 +1388,9 @@ static void internal_snapshot_clean(BlkTransactionState
*common)
InternalSnapshotState *state = DO_UPCAST(InternalSnapshotState,
common, common);
+ if (state->bs) {
+ bdrv_unlock(state->bs);
+ }
if (state->aio_context) {
aio_context_release(state->aio_context);
}
--
2.4.1
- [Qemu-devel] [PATCH v2 00/13] block: Protect block jobs with lock / unlock API, Fam Zheng, 2015/06/01
- [Qemu-devel] [PATCH v2 03/13] blockdev: Lock BDS during internal snapshot transaction,
Fam Zheng <=
- [Qemu-devel] [PATCH v2 04/13] blockdev: Lock BDS during external snapshot transaction, Fam Zheng, 2015/06/01
- [Qemu-devel] [PATCH v2 05/13] blockdev: Lock BDS during drive-backup transaction, Fam Zheng, 2015/06/01
- [Qemu-devel] [PATCH v2 06/13] blockdev: Lock BDS during blockdev-backup transaction, Fam Zheng, 2015/06/01
- [Qemu-devel] [PATCH v2 07/13] mirror: Protect source between bdrv_drain and bdrv_swap, Fam Zheng, 2015/06/01
- [Qemu-devel] [PATCH v2 08/13] block: Add bdrv_add_lock_unlock_notifier, Fam Zheng, 2015/06/01
- [Qemu-devel] [PATCH v2 09/13] block-backend: Add blk_add_lock_unlock_notifier, Fam Zheng, 2015/06/01
- [Qemu-devel] [PATCH v2 10/13] virtio-blk: Move complete_request to 'ops' structure, Fam Zheng, 2015/06/01
- [Qemu-devel] [PATCH v2 11/13] virtio-blk: Don't handle output when backend is locked, Fam Zheng, 2015/06/01
- [Qemu-devel] [PATCH v2 12/13] virtio-scsi-dataplane: Add backend lock listener, Fam Zheng, 2015/06/01
- [Qemu-devel] [PATCH v2 13/13] nbd-server: Clear "can_read" when backend is locked, Fam Zheng, 2015/06/01