From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfwOu-0007Ep-9d for qemu-devel@nongnu.org; Thu, 01 May 2014 15:12:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WfwOn-0003jE-GD for qemu-devel@nongnu.org; Thu, 01 May 2014 15:12:07 -0400 Received: from mail-yh0-f53.google.com ([209.85.213.53]:57637) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfwOn-0003j5-D4 for qemu-devel@nongnu.org; Thu, 01 May 2014 15:12:01 -0400 Received: by mail-yh0-f53.google.com with SMTP id i57so3284479yha.26 for ; Thu, 01 May 2014 12:12:01 -0700 (PDT) Date: Thu, 1 May 2014 16:12:03 -0300 From: Leandro Dorileo Message-ID: <20140501191203.GC29944@dorilex-lnv.MultilaserAP> References: <1398762521-25733-1-git-send-email-cyliu@suse.com> <1398762521-25733-4-git-send-email-cyliu@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1398762521-25733-4-git-send-email-cyliu@suse.com> Subject: Re: [Qemu-devel] [PATCH V26 03/32] QemuOpts: repurpose qemu_opts_print to replace print_option_parameters List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Chunyan Liu Cc: qemu-devel@nongnu.org, stefanha@redhat.com On Tue, Apr 29, 2014 at 05:08:12PM +0800, Chunyan Liu wrote: > Currently this function is not used anywhere. In later patches, it will > replace print_option_parameters. To avoid print info changes, change > qemu_opts_print from fprintf stderr to printf to keep consistent with > print_option_parameters, remove last printf and print size/number with > opt->value.uint instead of opt->str. > > Signed-off-by: Chunyan Liu Reviewed-by: Leandro Dorileo > --- > util/qemu-option.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/util/qemu-option.c b/util/qemu-option.c > index 5346c90..2be6995 100644 > --- a/util/qemu-option.c > +++ b/util/qemu-option.c > @@ -925,7 +925,7 @@ void qemu_opts_print(QemuOpts *opts) > > if (desc[0].name == NULL) { > QTAILQ_FOREACH(opt, &opts->head, next) { > - fprintf(stderr, "%s=\"%s\" ", opt->name, opt->str); > + printf("%s=\"%s\" ", opt->name, opt->str); > } > return; > } > @@ -938,12 +938,14 @@ void qemu_opts_print(QemuOpts *opts) > continue; > } > if (desc->type == QEMU_OPT_STRING) { > - fprintf(stderr, "%s='%s' ", desc->name, value); > + printf("%s='%s' ", desc->name, value); > + } else if ((desc->type == QEMU_OPT_SIZE || > + desc->type == QEMU_OPT_NUMBER) && opt) { > + printf("%s=%" PRId64 " ", desc->name, opt->value.uint); > } else { > - fprintf(stderr, "%s=%s ", desc->name, value); > + printf("%s=%s ", desc->name, value); > } > } > - fprintf(stderr, "\n"); > } > > static int opts_do_parse(QemuOpts *opts, const char *params, > -- > 1.8.4.5 > > -- Leandro Dorileo