On 7/19/19 8:35 AM, Aarushi Mehta wrote:
> Signed-off-by: Aarushi Mehta <mehta.aar...@gmail.com>
> ---
>  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

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to