提交 254aee4d 编写于 作者: P Paolo Bonzini 提交者: Fam Zheng

vvfat: make it thread-safe

Reviewed-by: NEric Blake <eblake@redhat.com>
Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: NFam Zheng <famz@redhat.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
Message-Id: <20170629132749.997-6-pbonzini@redhat.com>
Signed-off-by: NFam Zheng <famz@redhat.com>
上级 778b087e
......@@ -3078,8 +3078,14 @@ static int coroutine_fn
write_target_commit(BlockDriverState *bs, uint64_t offset, uint64_t bytes,
QEMUIOVector *qiov, int flags)
{
int ret;
BDRVVVFATState* s = *((BDRVVVFATState**) bs->opaque);
return try_commit(s);
qemu_co_mutex_lock(&s->lock);
ret = try_commit(s);
qemu_co_mutex_unlock(&s->lock);
return ret;
}
static void write_target_close(BlockDriverState *bs) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册