* This work is licensed under the terms of the GNU GPL, version 2 or later.
* See the COPYING file in the top-level directory.
*/
+#include <sys/time.h>
#include <sys/types.h>
#include <stdarg.h>
#include <stdio.h>
#include <getopt.h>
+#include <libgen.h>
#include "qemu-common.h"
#include "block_int.h"
" -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",
{
int readonly = 0;
int growable = 0;
- const char *sopt = "hVc:Crsnmg";
+ const char *sopt = "hVc:Crsnmgk";
struct option lopt[] = {
- { "help", 0, 0, 'h' },
- { "version", 0, 0, 'V' },
- { "offset", 1, 0, 'o' },
- { "cmd", 1, 0, 'c' },
- { "create", 0, 0, 'C' },
- { "read-only", 0, 0, 'r' },
- { "snapshot", 0, 0, 's' },
- { "nocache", 0, 0, 'n' },
- { "misalign", 0, 0, 'm' },
- { "growable", 0, 0, 'g' },
- { NULL, 0, 0, 0 }
+ { "help", 0, NULL, 'h' },
+ { "version", 0, NULL, 'V' },
+ { "offset", 1, NULL, 'o' },
+ { "cmd", 1, NULL, 'c' },
+ { "create", 0, NULL, 'C' },
+ { "read-only", 0, NULL, 'r' },
+ { "snapshot", 0, NULL, 's' },
+ { "nocache", 0, NULL, 'n' },
+ { "misalign", 0, NULL, 'm' },
+ { "growable", 0, NULL, 'g' },
+ { "native-aio", 0, NULL, 'k' },
+ { NULL, 0, NULL, 0 }
};
int c;
int opt_index = 0;
case 'g':
growable = 1;
break;
+ case 'k':
+ flags |= BDRV_O_NATIVE_AIO;
+ break;
case 'V':
printf("%s version %s\n", progname, VERSION);
exit(0);