Received: from eggs.gnu.org ([208.118.235.92]:37508) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVERT-0003Zi-AK for qemu-devel@nongnu.org; Thu, 25 Apr 2013 01:10:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UVERM-00064I-Gm for qemu-devel@nongnu.org; Thu, 25 Apr 2013 01:09:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34513) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVERM-000641-7m for qemu-devel@nongnu.org; Thu, 25 Apr 2013 01:09:52 -0400 Date: Thu, 25 Apr 2013 13:09:49 +0800 From: Amos Kong Message-ID: <20130425050949.GF3230@t430s.nay.redhat.com> References: <1366807646-8473-2-git-send-email-akong@redhat.com> <1366824804-24532-1-git-send-email-akong@redhat.com> <20130424142020.4e6a54a1@redhat.com> <517834DC.1040602@redhat.com> <20130425035258.GE3230@t430s.nay.redhat.com> <5178B0A4.3090409@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5178B0A4.3090409@redhat.com> Subject: Re: [Qemu-devel] [PATCH] monitor: introduce query-config-schema command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Osier Yang Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, Luiz Capitulino On Thu, Apr 25, 2013 at 12:27:16PM +0800, Osier Yang wrote: > On 25/04/13 11:52, Amos Kong wrote: > >On Wed, Apr 24, 2013 at 01:39:08PM -0600, Eric Blake wrote: > >>On 04/24/2013 12:20 PM, Luiz Capitulino wrote: > >>>On Thu, 25 Apr 2013 01:33:24 +0800 > >>>Amos Kong wrote: > >>> > >>>>Libvirt has no way to probe if an option or property is supported, > >>>>This patch introdues a new qmp command to query configuration schema > >>>>information. hmp command isn't added because it's not needed. > >>>> > >>>>V2: fix jaso schema and comments (Eric) > >... > > > >>>>+# > >>>>+# @flag: If no value is given, the flag is set to 1. Otherwise the value must > >>>>+# be "on" (set to 1) or "off" (set to 0) > >>>Let's call this 'boolean', because it's what it is. Also, I suggest > >>>'Accepts "on" or "off"' as the help text. > >>I'm fine with calling the enum value 'boolean' even where the C code > >>called it 'flag'. As long as we have a documented name that describes > >>the semantics of what the parameter will take, libvirt should be able to > >>cope. > >> > >>One other concern - you document that if a flag parameter is omitted, > >>then it defaults to 1. Is that really true? > > > >I'm wrong. If it's omitted in cmdline, we will give it a default value. > > > >example: > > enable_mlock = qemu_opt_get_bool(opts, "mlock", true); > > > >another example: > > -boot strict=on > > > > bool boot_strict; (false by default) > > > > strict boot is disabled by default, type of strict parameter is 'QEMU_OPT_STRING' > > the logical default parameter is "off". > > I didn't look through all the threads, not sure if it's already > clarified, but > is the "flags" indicates whether the option is enabled or disabled > by default? No, it used for used to enable/disable sth, not to save default value > If so, is it possible to have another "name" instead of "flag"? Or please > add documentation to tell more about the meaning. -- Amos.