qemu-devel
[Top][All Lists]
Advanced

[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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]