qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: wdongxu@cn.ibm.com, qemu-devel@nongnu.org, stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH V18 01/25] qemu-option: add def_value_str in QemuOptDesc struct and rewrite qemu_opts_print
Date: Wed, 28 Aug 2013 16:55:21 +0800	[thread overview]
Message-ID: <521DBAF9.9030202@linux.vnet.ibm.com> (raw)
In-Reply-To: <20130827134956.GH648@dhcp-200-207.str.redhat.com>

On 2013/8/27 21:49, Kevin Wolf wrote:
> Am 13.08.2013 um 06:31 hat Dong Xu Wang geschrieben:
>> qemu_opts_print has no user now, so can re-write the function safely.
>>
>> qemu_opts_print is used while using "qemu-img create", it
>> produces the same output as previous code.
>>
>> The behavior of this function has changed:
>>
>> 1. Print every possible option, whether a value has been set or not.
>> 2. Option descriptors may provide a default value.
>> 3. Print to stdout instead of stderr.
>>
>> Previously the behavior was to print every option that has been set.
>> Options that have not been set would be skipped.
>>
>> v17->v18:
>> 1) print opt->value.uint directly while type is QEMU_OPT_SIZE.
>>
>> v13->v14:
>> 1) fix memory leak.
>> 2) make opt_set do not accpet null value argument.
>>
>> v12->v13
>> 1) re-write commit message.
>>
>> v11->v12
>> 1) make def_value_str become the real default value string in opt_set
>> function.
>>
>> v10->v11:
>> 1) print all values that have actually been assigned while accept-any
>> cases.
>>
>> v7->v8:
>> 1) print "elements => accept any params" while opts_accepts_any() ==
>> true.
>> 2) since def_print_str is the default value if an option isn't set,
>> so rename it to def_value_str.
>>
>> Reviewed-by: Eric Blake <eblake@redhat.com>
>> Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
>> ---
>
> Please put the version history after the "---" line so that git am
> removes it when applying the patch.
>
Okay.
>>   include/qemu/option.h |  3 ++-
>>   util/qemu-option.c    | 34 ++++++++++++++++++++++++++++------
>>   2 files changed, 30 insertions(+), 7 deletions(-)
>>
>> diff --git a/include/qemu/option.h b/include/qemu/option.h
>> index 7a58e47..bbbdea3 100644
>> --- a/include/qemu/option.h
>> +++ b/include/qemu/option.h
>> @@ -96,6 +96,7 @@ typedef struct QemuOptDesc {
>>       const char *name;
>>       enum QemuOptType type;
>>       const char *help;
>> +    const char *def_value_str;
>>   } QemuOptDesc;
>>
>>   struct QemuOptsList {
>> @@ -153,7 +154,7 @@ QDict *qemu_opts_to_qdict(QemuOpts *opts, QDict *qdict);
>>   void qemu_opts_absorb_qdict(QemuOpts *opts, QDict *qdict, Error **errp);
>>
>>   typedef int (*qemu_opts_loopfunc)(QemuOpts *opts, void *opaque);
>> -int qemu_opts_print(QemuOpts *opts, void *dummy);
>> +int qemu_opts_print(QemuOpts *opts);
>
> Should be a void function, it can only return 0 anyway.
>
Okay.
Thanks Kevin, and together with other comments, I will send a new version.
> Kevin
>
>

  reply	other threads:[~2013-08-28  8:55 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-13  4:31 [Qemu-devel] [PATCH V18 00/25] replace QEMUOptionParameter with QemuOpts parser Dong Xu Wang
2013-08-13  4:31 ` [Qemu-devel] [PATCH V18 01/25] qemu-option: add def_value_str in QemuOptDesc struct and rewrite qemu_opts_print Dong Xu Wang
2013-08-27 13:49   ` Kevin Wolf
2013-08-28  8:55     ` Dong Xu Wang [this message]
2013-08-28 12:53   ` Eric Blake
2013-08-29  1:49     ` Dong Xu Wang
2013-08-13  4:31 ` [Qemu-devel] [PATCH V18 02/25] qemu-option: avoid duplication of default value in QemuOpts Dong Xu Wang
2013-08-28 12:57   ` Eric Blake
2013-08-29  1:49     ` Dong Xu Wang
2013-08-13  4:31 ` [Qemu-devel] [PATCH V18 03/25] qemu-option: create four QemuOptsList related functions Dong Xu Wang
2013-08-27 13:54   ` Kevin Wolf
2013-08-13  4:31 ` [Qemu-devel] [PATCH V18 04/25] qemu-option: create some QemuOpts functons Dong Xu Wang
2013-08-27 13:58   ` Kevin Wolf
2013-08-13  4:31 ` [Qemu-devel] [PATCH V18 05/25] qemu-option: opt->str store digit, without suffixes Dong Xu Wang
2013-08-27 14:01   ` Kevin Wolf
2013-08-13  4:31 ` [Qemu-devel] [PATCH V18 06/25] add interface to block Dong Xu Wang
2013-08-27 14:08   ` Kevin Wolf
2013-08-13  4:31 ` [Qemu-devel] [PATCH V18 07/25] block: add QemuOpts support for cow.c Dong Xu Wang
2013-08-13  4:31 ` [Qemu-devel] [PATCH V18 08/25] block: add QemuOpts support for gluster.c Dong Xu Wang
2013-08-13  4:31 ` [Qemu-devel] [PATCH V18 09/25] block: add QemuOpts support for iscsi.c Dong Xu Wang
2013-08-13  4:31 ` [Qemu-devel] [PATCH V18 10/25] block: add QemuOpts support for qcow.c Dong Xu Wang
2013-08-13  4:31 ` [Qemu-devel] [PATCH V18 11/25] block: add QemuOpts support for qcow2.c Dong Xu Wang
2013-08-13  4:31 ` [Qemu-devel] [PATCH V18 12/25] block: add QemuOpts support for qed.c Dong Xu Wang
2013-08-13  4:31 ` [Qemu-devel] [PATCH V18 13/25] block: add QemuOpts support for raw-posix.c Dong Xu Wang
2013-08-13  4:31 ` [Qemu-devel] [PATCH V18 14/25] block: add QemuOpts support for raw-win32.c Dong Xu Wang
2013-08-13  4:31 ` [Qemu-devel] [PATCH V18 15/25] block: add QemuOpts support for raw.c Dong Xu Wang
2013-08-13  4:31 ` [Qemu-devel] [PATCH V18 16/25] block: add QemuOpts support for rbd.c Dong Xu Wang
2013-08-13  4:31 ` [Qemu-devel] [PATCH V18 17/25] block: add QemuOpts support for sheepdog.c Dong Xu Wang
2013-08-13  4:31 ` [Qemu-devel] [PATCH V18 18/25] block: add QemuOpts support for ssh.c Dong Xu Wang
2013-08-13  4:32 ` [Qemu-devel] [PATCH V18 19/25] block: add QemuOpts support for vdi.c Dong Xu Wang
2013-08-13  4:32 ` [Qemu-devel] [PATCH V18 20/25] block: add QemuOpts support for vmdk.c Dong Xu Wang
2013-08-13  4:32 ` [Qemu-devel] [PATCH V18 21/25] block: add QemuOpts support for vpc.c Dong Xu Wang
2013-08-13  4:32 ` [Qemu-devel] [PATCH V18 22/25] block: add QemuOpts support for block.c Dong Xu Wang
2013-08-13  4:32 ` [Qemu-devel] [PATCH V18 23/25] block: clean temp code and use QemuOpts in block Dong Xu Wang
2013-08-13  4:32 ` [Qemu-devel] [PATCH V18 24/25] qapi: query-command-line-options outputs def_value_str Dong Xu Wang
2013-08-27 14:12   ` Kevin Wolf
2013-08-27 23:13     ` Eric Blake
2013-08-28  8:57       ` Dong Xu Wang
2013-08-13  4:32 ` [Qemu-devel] [PATCH V18 25/25] qemu-option: remove QEMUOptionParameter related functions and struct Dong Xu 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=521DBAF9.9030202@linux.vnet.ibm.com \
    --to=wdongxu@linux.vnet.ibm.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=wdongxu@cn.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).