qemu-img: adds option to use aio engine for benchmarking

Signed-off-by: Aarushi Mehta <mehta.aaru20@gmail.com>
Acked-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20200120141858.587874-13-stefanha@redhat.com
Message-Id: <20200120141858.587874-13-stefanha@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
Aarushi Mehta 2020-01-20 14:18:55 +00:00 committed by Stefan Hajnoczi
parent 1c5a2aecea
commit cdd267749a
3 changed files with 16 additions and 4 deletions

View file

@ -4187,7 +4187,8 @@ static int img_bench(int argc, char **argv)
{"force-share", no_argument, 0, 'U'},
{0, 0, 0, 0}
};
c = getopt_long(argc, argv, ":hc:d:f:no:qs:S:t:wU", long_options, NULL);
c = getopt_long(argc, argv, ":hc:d:f:ni:o:qs:S:t:wU", long_options,
NULL);
if (c == -1) {
break;
}
@ -4230,6 +4231,14 @@ static int img_bench(int argc, char **argv)
case 'n':
flags |= BDRV_O_NATIVE_AIO;
break;
case 'i':
ret = bdrv_parse_aio(optarg, &flags);
if (ret < 0) {
error_report("Invalid aio option: %s", optarg);
ret = -1;
goto out;
}
break;
case 'o':
{
offset = cvtnum(optarg);