From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:44015) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBixU-0001iN-2N for qemu-devel@nongnu.org; Thu, 06 Oct 2011 04:05:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RBixP-0000v8-77 for qemu-devel@nongnu.org; Thu, 06 Oct 2011 04:05:36 -0400 From: Alexander Graf Date: Thu, 6 Oct 2011 10:05:30 +0200 Message-Id: <1317888366-10509-29-git-send-email-agraf@suse.de> In-Reply-To: <1317888366-10509-1-git-send-email-agraf@suse.de> References: <1317888366-10509-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PATCH 28/64] device tree: give dt more size List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Blue Swirl , qemu-ppc@nongnu.org We currently load a device tree blob and then just take its size x2 to account for modifications we do inside. While this is nice and great, it fails when we have a small device tree as blob and lots of nodes added in machine init code. So for now, just make it 20k bigger than it was before. We maybe want to be more clever about this later. Signed-off-by: Alexander Graf --- device_tree.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/device_tree.c b/device_tree.c index 751538e..dc69232 100644 --- a/device_tree.c +++ b/device_tree.c @@ -41,6 +41,7 @@ void *load_device_tree(const char *filename_path, int *sizep) } /* Expand to 2x size to give enough room for manipulation. */ + dt_size += 10000; dt_size *= 2; /* First allocate space in qemu for device tree */ fdt = g_malloc0(dt_size); -- 1.6.0.2