From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NATaW-0000Oh-Fa for qemu-devel@nongnu.org; Tue, 17 Nov 2009 14:19:40 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NATaR-0000Lr-Ov for qemu-devel@nongnu.org; Tue, 17 Nov 2009 14:19:39 -0500 Received: from [199.232.76.173] (port=57337 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NATaR-0000Le-Av for qemu-devel@nongnu.org; Tue, 17 Nov 2009 14:19:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:24481) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NATaQ-00059s-P9 for qemu-devel@nongnu.org; Tue, 17 Nov 2009 14:19:35 -0500 Message-ID: <4B02F72D.2010305@redhat.com> Date: Tue, 17 Nov 2009 20:19:09 +0100 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] OPT_SIZE parsing References: <4B029916.6000809@collabora.co.uk> <200911171324.15230.paul@codesourcery.com> <4B02B1EF.70206@collabora.co.uk> <4B02D475.6040700@redhat.com> <4B02E746.2050007@collabora.co.uk> In-Reply-To: <4B02E746.2050007@collabora.co.uk> 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: Ian Molton Cc: Paul Brook , qemu-devel@nongnu.org On 11/17/09 19:11, Ian Molton wrote: > Gerd Hoffmann wrote: >> Maybe also create a common function for parsing called by both >> parse_size() and parse_option_size() to make sure OPT_SIZE and the new >> size property accept the same syntax? > > The thought crossed my mind, but then I thought that as none of the > other parsers share common code (yet), it didn't make sense. Well, when the parser is basically a simple strtoull() call it doesn't make sense. For the size and the postfix processing it makes sense IMHO, they easily get out of sync otherwise. For a 'bool' property (if qdev gets one some day) it would make sense too I think. > I can cook up another patch that allows the option parser to hook into > the property parsing functions, or vice-versa, if you like? Given that qemu-option.c is also used by the tools (qemu-img, ...) it will be much easier to have qdev use a option parser function than the other way around. >> Otherwise it looks fine to me. > > Cool - whats the submission procedure? I can make a git branch publicly > available or I can send patches to someone... Just send it to the list, one of the maintainers with commit access (most likely anthony) should pick it up. If it doesn't work try resending after 2-3 weeks. cheers, Gerd