[PATCH 5/5] query-command-line-options: return help message for legacy options

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Some legacy options that have arguments weren't added to
vm_config_groups[], so query-command-line-options returns a
NULL parameters infolist. This patch try to return help message
for this kind of legacy options.

Example:
 {
     "helpmsg": "\"-vnc display    start a VNC server on display\\n\"",
     "parameters": [
     ],
     "option": "vnc"
 },

Signed-off-by: Amos Kong <akong@xxxxxxxxxx>
---
 qapi-schema.json   | 5 ++++-
 util/qemu-config.c | 3 +++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/qapi-schema.json b/qapi-schema.json
index 05ced9d..b3e6f46 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -3943,13 +3943,16 @@
 # Details about a command line option, including its list of parameter details
 #
 # @option: option name
+# @helpmsg: help message for legacy options
 #
 # @parameters: an array of @CommandLineParameterInfo
 #
 # Since 1.5
 ##
 { 'type': 'CommandLineOptionInfo',
-  'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
+  'data': { 'option': 'str',
+            '*parameters': ['CommandLineParameterInfo'],
+            '*helpmsg': 'str' } }
 
 ##
 # @query-command-line-options:
diff --git a/util/qemu-config.c b/util/qemu-config.c
index de233d8..a2def03 100644
--- a/util/qemu-config.c
+++ b/util/qemu-config.c
@@ -176,6 +176,9 @@ CommandLineOptionInfoList *qmp_query_command_line_options(bool has_option,
             } else if (idx >= 0) {
                 info->parameters =
                     get_param_infolist(vm_config_groups[idx]->desc);
+            } else if (info->has_parameters) {
+                info->has_helpmsg = true;
+                info->helpmsg = g_strdup(option_helpmsgs[i]);
             }
 
             entry = g_malloc0(sizeof(*entry));
-- 
1.8.4.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]