aboutsummaryrefslogtreecommitdiff
path: root/qemu-io.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2009-08-20 16:58:35 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-08-27 20:30:22 -0500
commit5c6c3a6c54b23caa84fb4e046e85a461612279bb (patch)
tree7c23c2c86ca96f0a1b3dcbb86c70d5989e156710 /qemu-io.c
parent9ef91a677110ec200d7b2904fc4bcae5a77329ad (diff)
raw-posix: add Linux native AIO support
Now that do have a nicer interface to work against we can add Linux native AIO support. It's an extremly thing layer just setting up an iocb for the io_submit system call in the submission path, and registering an eventfd with the qemu poll handler to do complete the iocbs directly from there. This started out based on Anthony's earlier AIO patch, but after estimated 42,000 rewrites and just as many build system changes there's not much left of it. To enable native kernel aio use the aio=native sub-command on the drive command line. I have also added an option to qemu-io to test the aio support without needing a guest. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'qemu-io.c')
-rw-r--r--qemu-io.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/qemu-io.c b/qemu-io.c
index a68f195c11..f96a4de6b4 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -1401,6 +1401,7 @@ static void usage(const char *name)
" -n, --nocache disable host cache\n"
" -g, --growable allow file to grow (only applies to protocols)\n"
" -m, --misalign misalign allocations for O_DIRECT\n"
+" -k, --native-aio use kernel AIO implementation (on Linux only)\n"
" -h, --help display this help and exit\n"
" -V, --version output version information and exit\n"
"\n",
@@ -1412,7 +1413,7 @@ int main(int argc, char **argv)
{
int readonly = 0;
int growable = 0;
- const char *sopt = "hVc:Crsnmg";
+ const char *sopt = "hVc:Crsnmgk";
struct option lopt[] = {
{ "help", 0, NULL, 'h' },
{ "version", 0, NULL, 'V' },
@@ -1424,6 +1425,7 @@ int main(int argc, char **argv)
{ "nocache", 0, NULL, 'n' },
{ "misalign", 0, NULL, 'm' },
{ "growable", 0, NULL, 'g' },
+ { "native-aio", 0, NULL, 'k' },
{ NULL, 0, NULL, 0 }
};
int c;
@@ -1455,6 +1457,9 @@ int main(int argc, char **argv)
case 'g':
growable = 1;
break;
+ case 'k':
+ flags |= BDRV_O_NATIVE_AIO;
+ break;
case 'V':
printf("%s version %s\n", progname, VERSION);
exit(0);