From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mm6XP-0004Rv-CZ for qemu-devel@nongnu.org; Fri, 11 Sep 2009 09:51:43 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mm6XK-0004Jq-D4 for qemu-devel@nongnu.org; Fri, 11 Sep 2009 09:51:42 -0400 Received: from [199.232.76.173] (port=58412 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mm6XK-0004JV-5N for qemu-devel@nongnu.org; Fri, 11 Sep 2009 09:51:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32213) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mm6XI-0005El-Pp for qemu-devel@nongnu.org; Fri, 11 Sep 2009 09:51:37 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8BDpZKV032007 for ; Fri, 11 Sep 2009 09:51:35 -0400 Message-ID: <4AAA55E4.9040600@redhat.com> Date: Fri, 11 Sep 2009 15:51:32 +0200 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 06/19] Add qemu_opts_validate() for post parsing validation References: <1252595941-15196-1-git-send-email-markmc@redhat.com> <1252595941-15196-7-git-send-email-markmc@redhat.com> <4AAA00A9.6070600@redhat.com> <1252672691.20624.39.camel@blaa> In-Reply-To: <1252672691.20624.39.camel@blaa> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark McLoughlin Cc: qemu-devel@nongnu.org On 09/11/09 14:38, Mark McLoughlin wrote: > On Fri, 2009-09-11 at 09:47 +0200, Gerd Hoffmann wrote: >> (1) We can stick all possible values info QemuOptsList->desc. Then >> have separate data structures to describe which fields are allowed >> in which cases (and, while being at it, which fields are mandatory). > > You'd need to make it part of the QemuOptDesc to make it easy to figure > out from reading the code which parameters apply to which types. > > e.g. a QemuOptDesc::firstname_values field Yes, that would work as well. >> (2) We have multiple QemuOptDesc lists for the different cases. > > As with what I did, you'll have some parameters which are common to > different types. One of the reasons I'd prefer (1). cheers, Gerd