From: Ian Campbell Subject: Re: [PATCH 23 of 32 RFC] libxl: use libxl_*_init internally too Date: Mon, 16 Jan 2012 16:15:04 +0000 Message-ID: <1326730504.14689.17.camel@zakaz.uk.xensource.com> References: <0d3abdb6c01894e4e074.1326716121@cosworth.uk.xensource.com> <20244.19379.430191.296744@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20244.19379.430191.296744@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Jackson Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Mon, 2012-01-16 at 16:09 +0000, Ian Jackson wrote: > Ian Campbell writes ("[Xen-devel] [PATCH 23 of 32 RFC] libxl: use libxl_*_init internally too"): > > libxl: use libxl_*_init internally too > ... > > + ret = libxl_device_vfb_init(CTX, vfb); > > + if (ret) return ret; > > Can we make these init functions infallible ? (I haven't read > their code yet...) I think the reason is that sometimes they might allocate memory. Many of them don't (I don't know about vfb in particular) and I don't know whether we prefer consistency in similar functions or avoiding pointless return values (I prefer the former so as to avoid needing to change the public API in the future when we find that we have introduced a way for a function to fail). Possibly in the new world order (where init ~= memset and setdefaults does thework) this will no longer be the case, but then the same will become true of the setdefaults function. Ian.