mirror of
https://git.proxmox.com/git/qemu
synced 2025-08-06 22:33:05 +00:00
linux aio: some comments
Add some notes about Linux AIO explaining why we don't use AIO in some situations. Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
f69539b14b
commit
c30e624d5d
@ -236,6 +236,10 @@ static int raw_open_common(BlockDriverState *bs, const char *filename,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_LINUX_AIO
|
#ifdef CONFIG_LINUX_AIO
|
||||||
|
/*
|
||||||
|
* Currently Linux do AIO only for files opened with O_DIRECT
|
||||||
|
* specified so check NOCACHE flag too
|
||||||
|
*/
|
||||||
if ((bdrv_flags & (BDRV_O_NOCACHE|BDRV_O_NATIVE_AIO)) ==
|
if ((bdrv_flags & (BDRV_O_NOCACHE|BDRV_O_NATIVE_AIO)) ==
|
||||||
(BDRV_O_NOCACHE|BDRV_O_NATIVE_AIO)) {
|
(BDRV_O_NOCACHE|BDRV_O_NATIVE_AIO)) {
|
||||||
|
|
||||||
|
@ -181,6 +181,7 @@ BlockDriverAIOCB *laio_submit(BlockDriverState *bs, void *aio_ctx, int fd,
|
|||||||
case QEMU_AIO_READ:
|
case QEMU_AIO_READ:
|
||||||
io_prep_preadv(iocbs, fd, qiov->iov, qiov->niov, offset);
|
io_prep_preadv(iocbs, fd, qiov->iov, qiov->niov, offset);
|
||||||
break;
|
break;
|
||||||
|
/* Currently Linux kernel does not support other operations */
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "%s: invalid AIO request type 0x%x.\n",
|
fprintf(stderr, "%s: invalid AIO request type 0x%x.\n",
|
||||||
__func__, type);
|
__func__, type);
|
||||||
|
Loading…
Reference in New Issue
Block a user