From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58873) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVeLT-0003Aa-CC for qemu-devel@nongnu.org; Thu, 03 Apr 2014 05:54:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WVeLM-0006lo-LR for qemu-devel@nongnu.org; Thu, 03 Apr 2014 05:54:03 -0400 Received: from victor.provo.novell.com ([137.65.250.26]:51208) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVeLM-0006lL-9n for qemu-devel@nongnu.org; Thu, 03 Apr 2014 05:53:56 -0400 From: Chunyan Liu Date: Thu, 3 Apr 2014 17:54:29 +0800 Message-Id: <1396518889-21681-12-git-send-email-cyliu@suse.com> In-Reply-To: <1396518889-21681-1-git-send-email-cyliu@suse.com> References: <1396518889-21681-1-git-send-email-cyliu@suse.com> Subject: [Qemu-devel] [PATCH v24 11/31] qemu_opts_print: change fprintf stderr to printf List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: l@dorileo.org, stefanha@redhat.com Currently this function is not used anywhere. In later patches, it will replace print_option_parameters. print_option_parameters uses printf, to avoid print info changes after switching to QemuOpts, change qemu_opts_print from fprintf stderr to printf to keep consistent. Also to avoid print info changes, remove last printf and print size/number with opt->value.uint instead of opt->str. Signed-off-by: Chunyan Liu --- Changes: * remove last printf * add printf opt->value.uint for size/number type, keep same with QEMUOptionParameter print. (e.g. 10M printed as 10485760) 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 c4c7545..dc484a9 100644 --- a/util/qemu-option.c +++ b/util/qemu-option.c @@ -1032,7 +1032,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; } @@ -1045,12 +1045,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.7.12.4