[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH V26 03/32] QemuOpts: repurpose qemu_opts_print to re
From: |
Chunyan Liu |
Subject: |
[Qemu-devel] [PATCH V26 03/32] QemuOpts: repurpose qemu_opts_print to replace print_option_parameters |
Date: |
Tue, 29 Apr 2014 17:08:12 +0800 |
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 <address@hidden>
---
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
- [Qemu-devel] [PATCH V26 12/32] change block layer to support both QemuOpts and QEMUOptionParamter, (continued)
- [Qemu-devel] [PATCH V26 12/32] change block layer to support both QemuOpts and QEMUOptionParamter, Chunyan Liu, 2014/04/29
- [Qemu-devel] [PATCH V26 30/32] vpc.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/04/29
- [Qemu-devel] [PATCH V26 01/32] QemuOpts: move find_desc_by_name ahead for later calling, Chunyan Liu, 2014/04/29
- [Qemu-devel] [PATCH V26 04/32] qapi: output def_value_str when query command line options, Chunyan Liu, 2014/04/29
- [Qemu-devel] [PATCH V26 02/32] QemuOpts: add def_value_str to QemuOptDesc, Chunyan Liu, 2014/04/29
- [Qemu-devel] [PATCH V26 21/32] raw-posix.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/04/29
- [Qemu-devel] [PATCH V26 23/32] raw_bsd.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/04/29
- [Qemu-devel] [PATCH V26 10/32] QemuOpts: add qemu_opts_append to replace append_option_parameters, Chunyan Liu, 2014/04/29
- [Qemu-devel] [PATCH V26 18/32] qcow.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/04/29
- [Qemu-devel] [PATCH V26 19/32] qcow2.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/04/29
- [Qemu-devel] [PATCH V26 03/32] QemuOpts: repurpose qemu_opts_print to replace print_option_parameters,
Chunyan Liu <=
- [Qemu-devel] [PATCH V26 29/32] vmdk.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/04/29
- [Qemu-devel] [PATCH V26 17/32] nfs.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/04/29
- [Qemu-devel] [PATCH V26 22/32] raw-win32.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/04/29
- [Qemu-devel] [PATCH V26 11/32] QemuOpts: check NULL input for qemu_opts_del, Chunyan Liu, 2014/04/29
- [Qemu-devel] [PATCH V26 28/32] vhdx.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/04/29
- [Qemu-devel] [PATCH V26 16/32] iscsi.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/04/29
- [Qemu-devel] [PATCH V26 05/32] QemuOpts: change opt->name|str from (const char *) to (char *), Chunyan Liu, 2014/04/29
- [Qemu-devel] [PATCH V26 27/32] vdi.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/04/29
- [Qemu-devel] [PATCH V26 31/32] cleanup QEMUOptionParameter, Chunyan Liu, 2014/04/29