[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 05/13] blockdev: Lock BDS during drive-backup tra
From: |
Fam Zheng |
Subject: |
[Qemu-devel] [PATCH v2 05/13] blockdev: Lock BDS during drive-backup transaction |
Date: |
Tue, 2 Jun 2015 11:21:54 +0800 |
To save the bs pointer for drive_backup_clean, pull the assignment to
state->bs up. It will not be a problem for drive_backup_abort because
state->job will still be NULL.
Signed-off-by: Fam Zheng <address@hidden>
---
blockdev.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/blockdev.c b/blockdev.c
index a8d5b10..d7526f6 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -1586,6 +1586,8 @@ static void drive_backup_prepare(BlkTransactionState
*common, Error **errp)
/* AioContext is released in .clean() */
state->aio_context = bdrv_get_aio_context(bs);
aio_context_acquire(state->aio_context);
+ bdrv_lock(bs);
+ state->bs = bs;
qmp_drive_backup(backup->device, backup->target,
backup->has_format, backup->format,
@@ -1601,7 +1603,6 @@ static void drive_backup_prepare(BlkTransactionState
*common, Error **errp)
return;
}
- state->bs = bs;
state->job = state->bs->job;
}
@@ -1621,6 +1622,7 @@ static void drive_backup_clean(BlkTransactionState
*common)
DriveBackupState *state = DO_UPCAST(DriveBackupState, common, common);
if (state->aio_context) {
+ bdrv_unlock(state->bs);
aio_context_release(state->aio_context);
}
}
--
2.4.1
- [Qemu-devel] [PATCH v2 01/13] block: Use bdrv_drain to replace uncessary bdrv_drain_all, (continued)
- [Qemu-devel] [PATCH v2 03/13] blockdev: Lock BDS during internal snapshot transaction, Fam Zheng, 2015/06/01
- [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 <=
- [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