From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH 5/9] libxl: introduce libxl_cpupool_cpu{add, remove}_cpumap() Date: Wed, 11 Mar 2015 16:57:10 +0000 Message-ID: <1426093030.21353.328.camel@citrix.com> References: <20150306170758.7269.53821.stgit@Solace.station> <20150306172132.7269.83077.stgit@Solace.station> <20150309103935.GH18491@zion.uk.xensource.com> <1426092120.21353.323.camel@citrix.com> <1426092644.21405.16.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1426092644.21405.16.camel@citrix.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: Dario Faggioli Cc: "JGross@suse.com" , Ian Jackson , Stefano Stabellini , Wei Liu , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Wed, 2015-03-11 at 16:50 +0000, Dario Faggioli wrote: > On Wed, 2015-03-11 at 16:42 +0000, Ian Campbell wrote: > > On Mon, 2015-03-09 at 10:39 +0000, Wei Liu wrote: > > > rc = xc_cpupool_addcpu(ctx->xch, poolid, cpu); > > > > if (rc) { > > > > - LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, rc, > > > > - "Error moving cpu to cpupool"); > > > > + LOGE(ERROR, "Error moving cpu %d to cpupool", cpu); > > > > + GC_FREE; > > > > return ERROR_FAIL; > > > > } > > > > + GC_FREE; > > > > > > Please use "goto" idiom. Same applies to libxl_cpupool_cpuremove. > > > > TBH I think using LIBXL__LOG_ERRNOVAL in functions where the GC is > > otherwise unneeded in the entire call-chain, like here, is a reasonable > > exception to the usual rule. > > > And I distinctly remember someone of you tools people saying, about > another patch, that "using the new macro is well worth adding a > GC_INIT/FREE" :-D Could have even be me on another day ;-) > Of course, I'm fine with leaving this alone... just let me know what you > prefer. :-) Either use GC+goto style error paths or leave it alone, either is fine by me. Ian.