From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vuv6u-0005Xd-WA for qemu-devel@nongnu.org; Sun, 22 Dec 2013 21:19:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vuv6n-0007eF-AY for qemu-devel@nongnu.org; Sun, 22 Dec 2013 21:19:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:15924) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vuv6n-0007e7-2c for qemu-devel@nongnu.org; Sun, 22 Dec 2013 21:19:05 -0500 Date: Mon, 23 Dec 2013 10:19:00 +0800 From: Amos Kong Message-ID: <20131223021900.GA17346@amosk.info> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] fix/re-do query-command-line-options List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel , libvir-list@redhat.com Cc: Osier Yang , Markus Armbruster , rjones@redhat.com, laine@redhat.com, anthony@codemonkey.ws, pbonzini@redhat.com Hi QEMU/Libvirt list, When I worked on query-command-line-options, I first used some marcos [1] to generate two config & option tables. This will cover all the options, but it returns a string, it's difficult for libvirt to parse and use it. Finally I got a suggestion to read info from new interface (QemuOpts), We add opts info to vm_config_groups[], query-command-line-options will visit the array. It doesn't conver all the options, but the latest options are covered, so this implementation is acceptable. Problem: * QemuOpts was designed just for options with parameter, some new option without parameters is lost in query output (eg: -enable-fips) * block drive uses three QemuOpts, it's legacy issue. * QemuOpts of some options aren't updated, it might be difficult to updated when we add some new parameters * other We discussed to reimplement this command, but it seems DEF maroc is the only point to cover all the options, all the options are described in qemu-options.hx I'm considering to reuse the DEF marocs to generate a table, try to return the crude info if QemuOpts doesn't cover it. Or maintain a split array (like vm_config_groups[]), it only contains the option without parameter (option name & help info). If you touched some problem of the query-command-line-options, welcome to reply it, I will try to satisfy your requests. Thanks, Amos [1] http://www.redhat.com/archives/libvir-list/2013-January/msg01656.html |#elif defined(QEMU_OPTIONS_GENERATE_CONFIG) | |#define DEF(option, opt_arg, opt_enum, opt_help, arch_mask) \ | opt_help, | |#define DEFHEADING(text) |#define ARCHHEADING(text, arch_mask) | |#elif defined(QEMU_OPTIONS_GENERATE_NAME) | |#define DEF(option, opt_arg, opt_enum, opt_help, arch_mask) \ | option, | |#define DEFHEADING(text) |#define ARCHHEADING(text, arch_mask) char const *optionstr[] = { #define QEMU_OPTIONS_GENERATE_NAME #include "qemu-options-wrapper.h" }; char const *configstr[] = { #define QEMU_OPTIONS_GENERATE_CONFIG #include "qemu-options-wrapper.h" }; -- Amos.