diff options
author | Kevin Wolf <kwolf@redhat.com> | 2016-06-20 21:31:46 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2016-07-05 16:46:27 +0200 |
commit | a03ef88f77af045a2eb9629b5ce774a3fb973c5e (patch) | |
tree | eb38df63cf3b067a09f27681fa9ef55a1988776d /block/raw_bsd.c | |
parent | e293b7a3dff232ddf71e92ea88961b597586911e (diff) |
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>
Diffstat (limited to 'block/raw_bsd.c')
-rw-r--r-- | block/raw_bsd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/block/raw_bsd.c b/block/raw_bsd.c index 90b296e0a3..5f9dd299a6 100644 --- a/block/raw_bsd.c +++ b/block/raw_bsd.c @@ -105,7 +105,7 @@ raw_co_writev_flags(BlockDriverState *bs, int64_t sector_num, int nb_sectors, } BLKDBG_EVENT(bs->file, BLKDBG_WRITE_AIO); - ret = bdrv_co_pwritev(bs->file->bs, sector_num * BDRV_SECTOR_SIZE, + ret = bdrv_co_pwritev(bs->file, sector_num * BDRV_SECTOR_SIZE, nb_sectors * BDRV_SECTOR_SIZE, qiov, flags); fail: @@ -131,7 +131,7 @@ static int coroutine_fn raw_co_pwrite_zeroes(BlockDriverState *bs, int64_t offset, int count, BdrvRequestFlags flags) { - return bdrv_co_pwrite_zeroes(bs->file->bs, offset, count, flags); + return bdrv_co_pwrite_zeroes(bs->file, offset, count, flags); } static int coroutine_fn raw_co_discard(BlockDriverState *bs, |