Skip to content

Commit

Permalink
qcow2: call CoQueue APIs under CoMutex
Browse files Browse the repository at this point in the history
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20170629132749.997-2-pbonzini@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
  • Loading branch information
bonzini authored and Fam Zheng committed Jul 17, 2017
1 parent 4871b51 commit a8c5740
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions block/qcow2.c
Expand Up @@ -2025,8 +2025,6 @@ static coroutine_fn int qcow2_co_pwritev(BlockDriverState *bs, uint64_t offset,
ret = 0;

fail:
qemu_co_mutex_unlock(&s->lock);

while (l2meta != NULL) {
QCowL2Meta *next;

Expand All @@ -2040,6 +2038,8 @@ static coroutine_fn int qcow2_co_pwritev(BlockDriverState *bs, uint64_t offset,
l2meta = next;
}

qemu_co_mutex_unlock(&s->lock);

qemu_iovec_destroy(&hd_qiov);
qemu_vfree(cluster_data);
trace_qcow2_writev_done_req(qemu_coroutine_self(), ret);
Expand Down

0 comments on commit a8c5740

Please sign in to comment.