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:42:00 +0000 Message-ID: <1426092120.21353.323.camel@citrix.com> References: <20150306170758.7269.53821.stgit@Solace.station> <20150306172132.7269.83077.stgit@Solace.station> <20150309103935.GH18491@zion.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20150309103935.GH18491@zion.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: Wei Liu Cc: Juergen Gross , Dario Faggioli , Stefano Stabellini , Ian Jackson , Xen-devel List-Id: xen-devel@lists.xenproject.org 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. Ian.