summaryrefslogtreecommitdiffstats
path: root/qemu-nbd.c
diff options
context:
space:
mode:
authorAarushi Mehta2020-01-20 15:18:56 +0100
committerStefan Hajnoczi2020-01-30 22:01:38 +0100
commit7680274da1357c559373c2e14e13f3a5bf4fa100 (patch)
treec4684b58b2ea2f6b2dad6b91db2e4e986aa2d2c3 /qemu-nbd.c
parentqemu-img: adds option to use aio engine for benchmarking (diff)
downloadqemu-7680274da1357c559373c2e14e13f3a5bf4fa100.tar.gz
qemu-7680274da1357c559373c2e14e13f3a5bf4fa100.tar.xz
qemu-7680274da1357c559373c2e14e13f3a5bf4fa100.zip
qemu-nbd: adds option for aio engines
Signed-off-by: Aarushi Mehta <mehta.aaru20@gmail.com> Acked-by: Eric Blake <eblake@redhat.com> Acked-by: Stefano Garzarella <sgarzare@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20200120141858.587874-14-stefanha@redhat.com Message-Id: <20200120141858.587874-14-stefanha@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'qemu-nbd.c')
-rw-r--r--qemu-nbd.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/qemu-nbd.c b/qemu-nbd.c
index 108a51f7eb..db29a0d0ed 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -135,7 +135,7 @@ static void usage(const char *name)
" '[ID_OR_NAME]'\n"
" -n, --nocache disable host cache\n"
" --cache=MODE set cache mode (none, writeback, ...)\n"
-" --aio=MODE set AIO mode (native or threads)\n"
+" --aio=MODE set AIO mode (native, io_uring or threads)\n"
" --discard=MODE set discard mode (ignore, unmap)\n"
" --detect-zeroes=MODE set detect-zeroes mode (off, on, unmap)\n"
" --image-opts treat FILE as a full set of image options\n"
@@ -726,13 +726,9 @@ int main(int argc, char **argv)
exit(EXIT_FAILURE);
}
seen_aio = true;
- if (!strcmp(optarg, "native")) {
- flags |= BDRV_O_NATIVE_AIO;
- } else if (!strcmp(optarg, "threads")) {
- /* this is the default */
- } else {
- error_report("invalid aio mode `%s'", optarg);
- exit(EXIT_FAILURE);
+ if (bdrv_parse_aio(optarg, &flags) < 0) {
+ error_report("Invalid aio mode '%s'", optarg);
+ exit(EXIT_FAILURE);
}
break;
case QEMU_NBD_OPT_DISCARD: