[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v6 13/14] qemu-nbd: adds option for aio engines
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v6 13/14] qemu-nbd: adds option for aio engines |
Date: |
Fri, 19 Jul 2019 10:55:13 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 |
On 7/19/19 8:35 AM, Aarushi Mehta wrote:
> Signed-off-by: Aarushi Mehta <address@hidden>
> ---
> qemu-nbd.c | 12 ++++--------
> 1 file changed, 4 insertions(+), 8 deletions(-)
>
Missing a patch to qemu-nbd.texi to document this.
> diff --git a/qemu-nbd.c b/qemu-nbd.c
> index a8cb39e510..e5a71b3501 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"
> @@ -718,13 +718,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);
Nice - you're also fixing an indentation error. We aren't consistent on
whether error messages start with upper or lowercase, so I will overlook
that change.
But as long as you're touching the line, could you also change `' to be
''? The former form looks awkward in modern type, and while it was
popular 20 years ago, nowadays it makes programs look dated (or
identifies you as a user of m4...).
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v6 10/14] block/io_uring: adds userspace completion polling, (continued)
- [Qemu-devel] [PATCH v6 12/14] qemu-img: adds option to use aio engine, Aarushi Mehta, 2019/07/19
- [Qemu-devel] [PATCH v6 13/14] qemu-nbd: adds option for aio engines, Aarushi Mehta, 2019/07/19
- [Qemu-devel] [PATCH v6 14/14] qemu-iotest: enable testing with qemu-io aio options, Aarushi Mehta, 2019/07/19
- Re: [Qemu-devel] [PATCH v6 00/14] Add support for io_uring, no-reply, 2019/07/19
- Re: [Qemu-devel] [PATCH v6 00/14] Add support for io_uring, no-reply, 2019/07/19