From a03ef88f77af045a2eb9629b5ce774a3fb973c5e Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Mon, 20 Jun 2016 21:31:46 +0200 Subject: block: Convert bdrv_co_preadv/pwritev to BdrvChild This is the final patch for converting the common I/O path to take a BdrvChild parameter instead of BlockDriverState. The completion of this conversion means that all users that perform I/O on an image need to actually hold a reference (in the form of BdrvChild, possible as part of a BlockBackend) to that image. This also protects against inconsistent use of BlockBackend vs. BlockDriverState functions because direct use of a BlockDriverState isn't possible any more and blk->root is private for block-backends.c. In addition, we can now distinguish different users in the I/O path, and the future op blockers work is going to add assertions based on permissions stored in BdrvChild. Signed-off-by: Kevin Wolf Acked-by: Stefan Hajnoczi --- block/qcow2-cluster.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'block/qcow2-cluster.c') diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index 6a3ad90744..cf159f1d8e 100644 --- a/block/qcow2-cluster.c +++ b/block/qcow2-cluster.c @@ -446,7 +446,7 @@ static int coroutine_fn do_perform_cow(BlockDriverState *bs, } BLKDBG_EVENT(bs->file, BLKDBG_COW_WRITE); - ret = bdrv_co_pwritev(bs->file->bs, cluster_offset + offset_in_cluster, + ret = bdrv_co_pwritev(bs->file, cluster_offset + offset_in_cluster, bytes, &qiov, 0); if (ret < 0) { goto out; -- cgit v1.2.3