From: Gianni Tedesco Subject: Re: [PATCH]: xl: don't segfault parsing disk configs, support NULL physpath and ioemu: Date: Tue, 14 Dec 2010 18:21:30 +0000 Message-ID: <1292350890.11246.31.camel@qabil.uk.xensource.com> References: <1292326253.11246.25.camel@qabil.uk.xensource.com> <19719.44060.61050.108843@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <19719.44060.61050.108843@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Jackson Cc: "yang.z.zhang@intel.com" , Kamala Narasimhan , Christoph Egger , Xen Devel , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Tue, 2010-12-14 at 17:40 +0000, Ian Jackson wrote: > Gianni Tedesco writes ("[Xen-devel] [PATCH]: xl: don't segfault parsing disk configs, support NULL physpath and ioemu:"): > > Resending due to another user reported running in to this. Applies with > > offsets. > ... > > Switch to a state machine parser since it's easier to handle all these > > exotic cases without segfaulting. NULL physpaths are now allowed and a > > dodgy hack is introduced to skip over the "ioemu:" prefix for a > > virtpath. Also fixes a leak of buf2. > > Thanks, but I think the last time we had this we had some negative > feedback about the comprehensibility of this approach. Yes... from you :) > Perhaps a regexp- or flex- or bison- based approach would be better ? ISTR you said you'd do it in flex but since: 1. people are running to the bugs "out in the world" 2. we have an existing fix 3. I have no flex-fu 4. and we were in agreement that this code is as readable or more-so than a correct strtok-based implementation then why not take the fix we have now and improve if/when we need to in the future? Evidently nobody has touched this code for 6 months or more. > Ian. Gianni