[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH V16 6/7] query-command-line-options outputs def_valu
From: |
Dong Xu Wang |
Subject: |
[Qemu-devel] [PATCH V16 6/7] query-command-line-options outputs def_value_str |
Date: |
Tue, 18 Jun 2013 17:31:58 +0800 |
QMP command query-command-line-options shows details information of
parameters, since added def_value_str, also output it in the QMP
command.
Signed-off-by: Dong Xu Wang <address@hidden>
---
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 a80ee40..a9202b0 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -3541,12 +3541,15 @@
#
# @help: #optional human readable text string, not suitable for parsing.
#
+# @def_value_str: #optional default value string for the parameter
+#
# Since 1.5
##
{ 'type': 'CommandLineParameterInfo',
'data': { 'name': 'str',
'type': 'CommandLineParameterType',
- '*help': 'str' } }
+ '*help': 'str',
+ '*def_value_str': 'str'} }
##
# @CommandLineOptionInfo:
diff --git a/qmp-commands.hx b/qmp-commands.hx
index 8cea5e5..13430e3 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -2521,6 +2521,8 @@ Each array entry contains the following:
or 'size')
- "help": human readable description of the parameter
(json-string, optional)
+ - "def_value_str": default value string for the parameter
+ (json-string, optional)
Example:
diff --git a/util/qemu-config.c b/util/qemu-config.c
index a59568d..538d743 100644
--- a/util/qemu-config.c
+++ b/util/qemu-config.c
@@ -67,6 +67,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_def_value_str = true;
+ info->def_value_str = g_strdup(desc[i].def_value_str);
+ }
entry = g_malloc0(sizeof(*entry));
entry->value = info;
--
1.7.11.7
- [Qemu-devel] [PATCH V16 0/7] replace QEMUOptionParameter with QemuOpts parser, Dong Xu Wang, 2013/06/18
- [Qemu-devel] [PATCH V16 1/7] add def_value_str in QemuOptDesc struct and rewrite qemu_opts_print, Dong Xu Wang, 2013/06/18
- [Qemu-devel] [PATCH V16 2/7] avoid duplication of default value in QemuOpts, Dong Xu Wang, 2013/06/18
- [Qemu-devel] [PATCH V16 3/7] Create four QemuOptsList related functions, Dong Xu Wang, 2013/06/18
- [Qemu-devel] [PATCH V16 4/7] Create some QemuOpts functons, Dong Xu Wang, 2013/06/18
- [Qemu-devel] [PATCH V16 6/7] query-command-line-options outputs def_value_str,
Dong Xu Wang <=
- [Qemu-devel] [PATCH V16 7/7] remove QEMUOptionParameter related functions and struct, Dong Xu Wang, 2013/06/18
- [Qemu-devel] [PATCH V16 5/7] Use QemuOpts support in block layer, Dong Xu Wang, 2013/06/18