From: Ian Campbell Subject: Re: [PATCH v5 19/19] libxl: build a device tree for ARM guests Date: Thu, 14 Nov 2013 08:28:11 +0000 Message-ID: <1384417691.7059.25.camel@dagon.hellion.org.uk> References: <1384366234.29080.8.camel@kazak.uk.xensource.com> <1384366285-29277-19-git-send-email-ian.campbell@citrix.com> <5284219D.3060503@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5284219D.3060503@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: Ian Jackson , stefano.stabellini@eu.citrix.com, tim@xen.org, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Thu, 2013-11-14 at 01:04 +0000, Julien Grall wrote: > Why didn't you try to use fdt_open_into? It should fit our usage: ie, > grow up the size of the device tree. Actually, DTC uses this solution > when the fdt needs to be resized. It seemed to be far more complex -- you would need to wrap every potentially failing fdt operation in a while loop which does the realloc and open into on ENOSPACE. Now that could be done by a macro but it would need to have much wider scope than here since it would be needed all the way down the call chain. This way the functions building each node don't need to worry about all that and only the toplevel needs to care. I'd be in favour of increasing the default allocation size before I wanted to switch the mechanism like this. Ian.