[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v24 11/31] qemu_opts_print: change fprintf stderr to
From: |
Chunyan Liu |
Subject: |
[Qemu-devel] [PATCH v24 11/31] qemu_opts_print: change fprintf stderr to printf |
Date: |
Thu, 3 Apr 2014 17:54:29 +0800 |
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 <address@hidden>
---
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
- [Qemu-devel] [PATCH v24 05/31] QemuOpts: move qemu_opt_del ahead for later calling, (continued)
- [Qemu-devel] [PATCH v24 05/31] QemuOpts: move qemu_opt_del ahead for later calling, Chunyan Liu, 2014/04/03
- [Qemu-devel] [PATCH v24 04/31] QemuOpts: change opt->name|str from (const char *) to (char *), Chunyan Liu, 2014/04/03
- [Qemu-devel] [PATCH v24 08/31] QemuOpts: add conversion between QEMUOptionParameter to QemuOpts, Chunyan Liu, 2014/04/03
- [Qemu-devel] [PATCH v24 06/31] QemuOpts: add qemu_opt_get_*_del functions for replace work, Chunyan Liu, 2014/04/03
- [Qemu-devel] [PATCH v24 07/31] QemuOpts: add qemu_opts_print_help to replace print_option_help, Chunyan Liu, 2014/04/03
- [Qemu-devel] [PATCH v24 10/31] QemuOpts: check NULL input for qemu_opts_del, Chunyan Liu, 2014/04/03
- [Qemu-devel] [PATCH v24 12/31] change block layer to support both QemuOpts and QEMUOptionParamter, Chunyan Liu, 2014/04/03
- [Qemu-devel] [PATCH v24 11/31] qemu_opts_print: change fprintf stderr to printf,
Chunyan Liu <=
- [Qemu-devel] [PATCH v24 15/31] gluster.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/04/03
- [Qemu-devel] [PATCH v24 14/31] cow.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/04/03
- [Qemu-devel] [PATCH v24 13/31] vvfat.c: handle cross_driver's create_options and create_opts, Chunyan Liu, 2014/04/03
- [Qemu-devel] [PATCH v24 16/31] iscsi.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/04/03
- [Qemu-devel] [PATCH v24 20/31] raw-posix.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/04/03
- [Qemu-devel] [PATCH v24 22/31] raw_bsd.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/04/03
- [Qemu-devel] [PATCH v24 19/31] qed.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/04/03
- [Qemu-devel] [PATCH v24 21/31] raw-win32.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/04/03
- [Qemu-devel] [PATCH v24 17/31] qcow.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/04/03
- [Qemu-devel] [PATCH v24 18/31] qcow2.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/04/03