From: Ian Jackson Subject: Re: [PATCH 15/15] libxl: New event generation API Date: Tue, 13 Dec 2011 14:14:56 +0000 Message-ID: <20199.24032.555383.178696@mariner.uk.xensource.com> References: <1323108621-22654-1-git-send-email-ian.jackson@eu.citrix.com> <1323108621-22654-16-git-send-email-ian.jackson@eu.citrix.com> <20194.22539.574524.956955@mariner.uk.xensource.com> <1323463293.20936.11.camel@dagon.hellion.org.uk> <20197.59428.699013.507183@mariner.uk.xensource.com> <1323692225.20077.183.camel@zakaz.uk.xensource.com> <20197.62462.189827.239656@mariner.uk.xensource.com> <1323697723.20077.212.camel@zakaz.uk.xensource.com> <20198.9737.680162.103418@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Stefano Stabellini Cc: "xen-devel@lists.xensource.com" , Ian Campbell List-Id: xen-devel@lists.xenproject.org Stefano Stabellini writes ("Re: [Xen-devel] [PATCH 15/15] libxl: New event generation API"): > +#define GC_INIT(ctx) libxl__gc *gc = libxl__init_gc(ctx); if (gc == NULL) return ERROR_NOMEM; I think we should avoid macros which return from their containing function, unless they are unavoidable. Only event-generating libxl entrypoints need to know about the special rules for handling the lock and ctx. The set of event-generating entrypoints to libxl is bounded - they are all part of the event generation core. Also, what you are doing here complicates the usual, simple, case. I would prefer to keep the case that can be simple, simple. So I think in this case it is better to document the restrictions rather than try to abolish them with additional behind-the-scenes machinery. See also Ian C's comments. Ian.