qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Dongxu Wang <wdongxu@linux.vnet.ibm.com>
Cc: qemu-devel@nongnu.org, armbru@redhat.com
Subject: Re: [Qemu-devel] [PATCH V15 2/6] avoid duplication of default value in QemuOpts
Date: Thu, 30 May 2013 15:25:51 -0600	[thread overview]
Message-ID: <51A7C3DF.9030400@redhat.com> (raw)
In-Reply-To: <1369907728-4175-3-git-send-email-wdongxu@linux.vnet.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 1446 bytes --]

On 05/30/2013 03:55 AM, Dongxu Wang wrote:
> From: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
> 
> 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 <wdongxu@linux.vnet.ibm.com>
> 
> v13->v14:
> 1) change code style.
> 2) assert errors.
> Signed-off-by: Dongxu Wang <wdongxu@linux.vnet.ibm.com>

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 <eblake@redhat.com>

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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]

  reply	other threads:[~2013-05-30 21:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-30  9:55 [Qemu-devel] [PATCH V15 0/6] replace QEMUOptionParameter with QemuOpts parser Dongxu Wang
2013-05-30  9:55 ` [Qemu-devel] [PATCH V15 1/6] add def_value_str in QemuOptDesc struct and rewrite qemu_opts_print Dongxu Wang
2013-05-30 21:22   ` Eric Blake
2013-05-31  2:21     ` Dongxu Wang
2013-05-30  9:55 ` [Qemu-devel] [PATCH V15 2/6] avoid duplication of default value in QemuOpts Dongxu Wang
2013-05-30 21:25   ` Eric Blake [this message]
2013-05-30  9:55 ` [Qemu-devel] [PATCH V15 3/6] Create four QemuOptsList related functions Dongxu Wang
2013-05-30 21:43   ` Eric Blake
2013-05-31  2:26     ` Dongxu Wang
2013-05-30  9:55 ` [Qemu-devel] [PATCH V15 4/6] Create some QemuOpts functons Dongxu Wang
2013-05-30  9:55 ` [Qemu-devel] [PATCH V15 5/6] Use QemuOpts support in block layer Dongxu Wang
2013-05-30  9:55 ` [Qemu-devel] [PATCH V15 6/6] remove QEMUOptionParameter related functions and struct Dongxu Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51A7C3DF.9030400@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wdongxu@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).