Signed-off-by: Frediano Ziglio <fredd...@gmail.com> --- block/raw-posix.c | 7 +++++++ linux-aio.c | 3 +++ 2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/block/raw-posix.c b/block/raw-posix.c index 3c6bd4b..27ae81e 100644 --- a/block/raw-posix.c +++ b/block/raw-posix.c @@ -628,6 +628,13 @@ static BlockDriverAIOCB *raw_aio_flush(BlockDriverState *bs, if (fd_open(bs) < 0) return NULL; +#ifdef CONFIG_LINUX_AIO + if (s->use_aio) { + return laio_submit(bs, s->aio_ctx, s->fd, 0, NULL, + 0, cb, opaque, QEMU_AIO_FLUSH); + } +#endif + return paio_submit(bs, s->fd, 0, NULL, 0, cb, opaque, QEMU_AIO_FLUSH); } diff --git a/linux-aio.c b/linux-aio.c index 68f4b3d..d07c435 100644 --- a/linux-aio.c +++ b/linux-aio.c @@ -215,6 +215,9 @@ BlockDriverAIOCB *laio_submit(BlockDriverState *bs, void *aio_ctx, int fd, case QEMU_AIO_READ: io_prep_preadv(iocbs, fd, qiov->iov, qiov->niov, offset); break; + case QEMU_AIO_FLUSH: + io_prep_fdsync(iocbs, fd); + break; default: fprintf(stderr, "%s: invalid AIO request type 0x%x.\n", __func__, type); -- 1.7.1