diff options
author | Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> | 2019-04-22 17:58:30 +0300 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2019-04-30 15:29:00 +0200 |
commit | 371420e2173b8055f82366bdb366f9399c7d9c3c (patch) | |
tree | db5c503e6520fb168cf354d097cfacb78009a034 /include/block/block_int.h | |
parent | e1f4a37a49ebb346d846eddc5cd4ebbb7afd9990 (diff) | |
download | qemu-371420e2173b8055f82366bdb366f9399c7d9c3c.zip qemu-371420e2173b8055f82366bdb366f9399c7d9c3c.tar.gz qemu-371420e2173b8055f82366bdb366f9399c7d9c3c.tar.bz2 |
block: introduce byte-based io helpers
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include/block/block_int.h')
-rw-r--r-- | include/block/block_int.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/block/block_int.h b/include/block/block_int.h index 01e855a..94d45c9 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -925,6 +925,22 @@ int coroutine_fn bdrv_co_pwritev(BdrvChild *child, int64_t offset, unsigned int bytes, QEMUIOVector *qiov, BdrvRequestFlags flags); +static inline int coroutine_fn bdrv_co_pread(BdrvChild *child, + int64_t offset, unsigned int bytes, void *buf, BdrvRequestFlags flags) +{ + QEMUIOVector qiov = QEMU_IOVEC_INIT_BUF(qiov, buf, bytes); + + return bdrv_co_preadv(child, offset, bytes, &qiov, flags); +} + +static inline int coroutine_fn bdrv_co_pwrite(BdrvChild *child, + int64_t offset, unsigned int bytes, void *buf, BdrvRequestFlags flags) +{ + QEMUIOVector qiov = QEMU_IOVEC_INIT_BUF(qiov, buf, bytes); + + return bdrv_co_pwritev(child, offset, bytes, &qiov, flags); +} + extern unsigned int bdrv_drain_all_count; void bdrv_apply_subtree_drain(BdrvChild *child, BlockDriverState *new_parent); void bdrv_unapply_subtree_drain(BdrvChild *child, BlockDriverState *old_parent); |