block: Convert bdrv_co_preadv/pwritev to BdrvChild
commita03ef88f77af045a2eb9629b5ce774a3fb973c5e
authorKevin Wolf <kwolf@redhat.com>
Mon, 20 Jun 2016 19:31:46 +0000 (20 21:31 +0200)
committerKevin Wolf <kwolf@redhat.com>
Tue, 5 Jul 2016 14:46:27 +0000 (5 16:46 +0200)
treeeb38df63cf3b067a09f27681fa9ef55a1988776d
parente293b7a3dff232ddf71e92ea88961b597586911e
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 <kwolf@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
12 files changed:
block/blkreplay.c
block/block-backend.c
block/bochs.c
block/io.c
block/qcow2-cluster.c
block/qcow2.c
block/raw_bsd.c
block/vdi.c
block/vmdk.c
block/vpc.c
include/block/block.h
include/block/block_int.h