From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [PATCH V3] libxl: write IO ABI for disk frontends Date: Fri, 26 Apr 2013 12:01:35 +0100 Message-ID: <517A5E8F.6000406@eu.citrix.com> References: <1366925808-27804-1-git-send-email-wei.liu2@citrix.com> <1366967931.3142.48.camel@zakaz.uk.xensource.com> <20130426094411.GH27096@zion.uk.xensource.com> <1366969955.3142.54.camel@zakaz.uk.xensource.com> <20130426101137.GI27096@zion.uk.xensource.com> <1366971779.3142.59.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1366971779.3142.59.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: Roger Pau Monne , Wei Liu , Valtteri Kiviniemi , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On 26/04/13 11:22, Ian Campbell wrote: > On Fri, 2013-04-26 at 11:11 +0100, Wei Liu wrote: >> On Fri, Apr 26, 2013 at 10:52:35AM +0100, Ian Campbell wrote: >> [...] >>>>>> + flexarray_append(front, p); >>>>> GCSPRINTF would be the right way to do this, but actually you can pass >>>>> protocol directly to flexarray_append, that is fine since the flexarray >>>>> never frees the values which it contains so they either need to be gc'd, >>>>> string constants or managed manually. >>>>> >>>> Oh thanks for the hint. This saves serveral lines of code. The (void *) >>>> argument of flexarray_append misled me. ;-) >>>> >>>> Below is updated version of the patch. Casting "protocol" to (void *) is >>>> necessary to have it compiled. Otherwise gcc complains we discard the >>>> const quilifier. >>> Oh, sorry, if this is the case the libxl__strdup(gc,protocol) is better >>> than the cast. Sorry for misleading :-( >>> >>> Now you mention it I do seem to recall trying to correctly constify >>> flexarray's at one point and not quite being able to make it work. >>> >> Another version with libxl__strdup(). :-) > Thanks! > > George, this is on your tracking list and is a bug fix and/or a > regression from Xend. Are you happy to give it a freeze exception? Yes, I think this is fine to go in. -George