qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH V15 2/6] avoid duplication of default value in Q


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH V15 2/6] avoid duplication of default value in QemuOpts
Date: Thu, 30 May 2013 15:25:51 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6

On 05/30/2013 03:55 AM, Dongxu Wang wrote:
> From: Dong Xu Wang <address@hidden>
> 
> This patch will move the default value entirely to QemuOptDesc.
> 
> When getting the value of an option that hasn't been set, and
> QemuOptDesc has a default value, return that.  Else, behave as
> before.
> 
> Example: qemu_opt_get_number(opts, "foo", 42)
> 
>    If "foo" has been set in opts, return its value.
> 
>    Else, if opt's QemuOptDesc has a default value for "foo", return
>    that.
> 
>    Else, return 42.
> 
>    Note that the last argument is useless when QemuOptDesc has a
>    default value.  Ugly.  If it bothers us, we could assert.
> 
> Example: qemu_opt_get(opts, "bar")
> 
>    If "bar" has been set in opts, return its value.
> 
>    Else, if opt's QemuOptDesc has a default value for "bar", return
>    that.
> 
>    Else, return NULL.
> 
> Signed-off-by: Dong Xu Wang <address@hidden>
> 
> v13->v14:
> 1) change code style.
> 2) assert errors.
> Signed-off-by: Dongxu Wang <address@hidden>

Again, a bit of a mess at the tail of the commit message.

> ---
>  util/qemu-option.c | 66 
> ++++++++++++++++++++++++++++++++++++++++--------------
>  1 file changed, 49 insertions(+), 17 deletions(-)
> 

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]