qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 01/20] nbd: produce a better error if neither


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v3 01/20] nbd: produce a better error if neither host nor port is passed
Date: Mon, 17 Feb 2014 11:48:28 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

On 02/17/2014 06:43 AM, Paolo Bonzini wrote:
> Before:
>     $ qemu-io-old
>     qemu-io-old> open -r -o file.driver=nbd
>     qemu-io-old: can't open device (null): Could not open image: Invalid 
> argument
>     $ ./qemu-io-old
>     qemu-io-old> open -r -o file.driver=nbd,file.host=foo,file.path=bar
>     path and host may not be used at the same time.
>     qemu-io-old: can't open device (null): Could not open image: Invalid 
> argument
> 

> +    if (qdict_haskey(options, "path") == qdict_haskey(options, "host")) {
> +        if (qdict_haskey(options, "path")) {
>              qerror_report(ERROR_CLASS_GENERIC_ERROR, "path and host may not "
>                            "be used at the same time.");

Pre-existing, but we tend to not use trailing '.' in error messages...

> -            return -EINVAL;
> +        } else {
> +            qerror_report(ERROR_CLASS_GENERIC_ERROR, "one of path and host "
> +                          "must be specified.");

so you might as well fix the old one and not add a new instance of it.

But that's minor enough that I don't mind:

Reviewed-by: Eric Blake <address@hidden>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]