From: Ian Jackson Subject: Re: [PATCH] libxl: add a dummy ao_how to libxl_domain_core_dump Date: Mon, 16 Apr 2012 17:31:16 +0100 Message-ID: <20364.18772.529397.220632@mariner.uk.xensource.com> References: <20364.16337.971144.457146@mariner.uk.xensource.com> <1334591807.14560.220.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1334591807.14560.220.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: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org Ian Campbell writes ("Re: [PATCH] libxl: add a dummy ao_how to libxl_domain_core_dump"): > On Mon, 2012-04-16 at 16:50 +0100, Ian Jackson wrote: > > Ian Campbell writes ("[PATCH] libxl: add a dummy ao_how to libxl_domain_core_dump"): > > > libxl: add a dummy ao_how to libxl_domain_core_dump > > > - return ERROR_FAIL; > > > + rc = ERROR_FAIL; > > > > While you're doing that, did you want to change it to use "goto out" ? > > wouldn't the "out:" be immediately after this immediately following > closing brace? I think it would look like this: > > > + rc = ERROR_FAIL; goto out; > > > } > > > - return 0; > > > + rc = 0; out: > > > + libxl__ao_complete(egc, ao, rc); > > > + > > > + return AO_INPROGRESS; And removing the initialisation of rc at the top of the function. This pattern is the usual one when we have an operation which should fail, and stop executing, when any sub-operations fail. Setting rc=0 at the top and setting it to ERROR_FAIL as we go, without an error exit, is what we do if we want to blunder on after errors (eg the remove files patch). Ian.