Skip to content

Commit

Permalink
qemu-nbd: adds option for aio engines
Browse files Browse the repository at this point in the history
Signed-off-by: Aarushi Mehta <[email protected]>
Acked-by: Eric Blake <[email protected]>
Acked-by: Stefano Garzarella <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
Message-id: [email protected]
Message-Id: <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
  • Loading branch information
rooshm authored and stefanhaRH committed Jan 30, 2020
1 parent cdd2677 commit 7680274
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions docs/interop/qemu-nbd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ driver options if ``--image-opts`` is specified.

.. option:: --aio=AIO

Set the asynchronous I/O mode between ``threads`` (the default)
and ``native`` (Linux only).
Set the asynchronous I/O mode between ``threads`` (the default),
``native`` (Linux only), and ``io_uring`` (Linux 5.1+).

.. option:: --discard=DISCARD

Expand Down
12 changes: 4 additions & 8 deletions qemu-nbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 7680274

Please sign in to comment.