diff options
author | Kevin Wolf <kwolf@redhat.com> | 2014-08-06 17:18:07 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2016-06-16 15:19:55 +0200 |
commit | 2174f12bdeb3974141784e14bbb7ad8c53178cd9 (patch) | |
tree | 3e20c21f794016df24d86529a9540c1fd3b42dd6 /block/raw-aio.h | |
parent | 9896c8765fdd916844596c3e6929b3c641e930b1 (diff) |
raw-posix: Switch to bdrv_co_* interfaces
In order to use the modern byte-based .bdrv_co_preadv/pwritev()
interface, this patch switches raw-posix to coroutine-based interfaces
as a first step. In terms of semantics and performance, it doesn't make
a difference with the existing code whether we go from a coroutine to a
callback-based interface already in block/io.c or only in linux-aio.c
As there have been concerns in the past that this change may be a step
in the wrong direction with respect to a possible AIO fast path, the
old callback-based interface for linux-aio is left around and can be
reactivated when a fast path (e.g. directly from virtio-blk dataplane,
bypassing the whole block layer) is implemented.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/raw-aio.h')
-rw-r--r-- | block/raw-aio.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/block/raw-aio.h b/block/raw-aio.h index 714714e016..03bbfba565 100644 --- a/block/raw-aio.h +++ b/block/raw-aio.h @@ -15,6 +15,7 @@ #ifndef QEMU_RAW_AIO_H #define QEMU_RAW_AIO_H +#include "qemu/coroutine.h" #include "qemu/iov.h" /* AIO request types */ @@ -38,6 +39,9 @@ typedef struct LinuxAioState LinuxAioState; LinuxAioState *laio_init(void); void laio_cleanup(LinuxAioState *s); +int coroutine_fn laio_co_submit(BlockDriverState *bs, LinuxAioState *s, int fd, + int64_t sector_num, QEMUIOVector *qiov, + int nb_sectors, int type); BlockAIOCB *laio_submit(BlockDriverState *bs, LinuxAioState *s, int fd, int64_t sector_num, QEMUIOVector *qiov, int nb_sectors, BlockCompletionFunc *cb, void *opaque, int type); |