[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH V26 04/32] qapi: output def_value_str when query com
From: |
Chunyan Liu |
Subject: |
[Qemu-devel] [PATCH V26 04/32] qapi: output def_value_str when query command line options |
Date: |
Tue, 29 Apr 2014 17:08:13 +0800 |
Change qapi interfaces to output the newly added def_value_str when querying
command line options.
Signed-off-by: Dong Xu Wang <address@hidden>
Signed-off-by: Chunyan Liu <address@hidden>
---
Changes to V25:
* update @default description in .json file
qapi-schema.json | 5 ++++-
qmp-commands.hx | 2 ++
util/qemu-config.c | 4 ++++
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/qapi-schema.json b/qapi-schema.json
index 0b00427..880829d 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -4088,12 +4088,15 @@
#
# @help: #optional human readable text string, not suitable for parsing.
#
+# @default: #optional default value string (since 2.1)
+#
# Since 1.5
##
{ 'type': 'CommandLineParameterInfo',
'data': { 'name': 'str',
'type': 'CommandLineParameterType',
- '*help': 'str' } }
+ '*help': 'str',
+ '*default': 'str' } }
##
# @CommandLineOptionInfo:
diff --git a/qmp-commands.hx b/qmp-commands.hx
index ed3ab92..1271332 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -2895,6 +2895,8 @@ Each array entry contains the following:
or 'size')
- "help": human readable description of the parameter
(json-string, optional)
+ - "default": default value string for the parameter
+ (json-string, optional)
Example:
diff --git a/util/qemu-config.c b/util/qemu-config.c
index f4e4f38..ba375c0 100644
--- a/util/qemu-config.c
+++ b/util/qemu-config.c
@@ -82,6 +82,10 @@ static CommandLineParameterInfoList
*query_option_descs(const QemuOptDesc *desc)
info->has_help = true;
info->help = g_strdup(desc[i].help);
}
+ if (desc[i].def_value_str) {
+ info->has_q_default = true;
+ info->q_default = g_strdup(desc[i].def_value_str);
+ }
entry = g_malloc0(sizeof(*entry));
entry->value = info;
--
1.8.4.5
- [Qemu-devel] [PATCH V26 08/32] QemuOpts: add qemu_opts_print_help to replace print_option_help, (continued)
- [Qemu-devel] [PATCH V26 08/32] QemuOpts: add qemu_opts_print_help to replace print_option_help, Chunyan Liu, 2014/04/29
- [Qemu-devel] [PATCH V26 32/32] QemuOpts: cleanup tmp 'allocated' member from QemuOptsList, Chunyan Liu, 2014/04/29
- [Qemu-devel] [PATCH V26 15/32] gluster.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/04/29
- [Qemu-devel] [PATCH V26 14/32] cow.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/04/29
- [Qemu-devel] [PATCH V26 25/32] sheepdog.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/04/29
- [Qemu-devel] [PATCH V26 09/32] QemuOpts: add conversion between QEMUOptionParameter to QemuOpts, Chunyan Liu, 2014/04/29
- [Qemu-devel] [PATCH V26 13/32] vvfat.c: handle cross_driver's create_options and create_opts, Chunyan Liu, 2014/04/29
- [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 <=
- [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, 2014/04/29
- [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