From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Egger Subject: Re: [PATCH] xl create: endless loop Date: Tue, 19 Oct 2010 10:31:31 +0200 Message-ID: <201010191031.32340.Christoph.Egger@amd.com> References: <201010181450.36050.Christoph.Egger@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Boundary-00=_kdVvMxW3R1WqzLt" Return-path: In-Reply-To: <201010181450.36050.Christoph.Egger@amd.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: xen-devel@lists.xensource.com, Ian Jackson List-Id: xen-devel@lists.xenproject.org --Boundary-00=_kdVvMxW3R1WqzLt Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Monday 18 October 2010 14:50:35 Christoph Egger wrote: > Hi! > > I cannot start a guest with 'xl create' due to an endless loop in libxl.c, > function libxl__get_free_memory_slack(): > > There is this code snippet: > > retry: > free_mem_slack_s = libxl__xs_read(gc, XBT_NULL, free_mem_slack_path); > if (!free_mem_slack_s) { > rc = libxl__fill_dom0_memory_info(gc, &target_memkb); > if (rc < 0) > return rc; > goto retry; > } else { > > > libxl__xs_read() returns 0 and libxl__fill_dom0_memory_info() also returns > 0. So there's a loop of retries. Attached patch fixes the endless loop. Signed-off-by: Christoph Egger -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Einsteinring 24, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632 --Boundary-00=_kdVvMxW3R1WqzLt Content-Type: text/x-diff; charset="iso 8859-15"; name="xen_xl.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xen_xl.diff" diff -r 9d8d6b93114e tools/libxl/libxl.c --- a/tools/libxl/libxl.c Mon Oct 18 15:24:39 2010 +0200 +++ b/tools/libxl/libxl.c Tue Oct 19 10:29:00 2010 +0200 @@ -2836,7 +2836,7 @@ retry: free_mem_slack_s = libxl__xs_read(gc, XBT_NULL, free_mem_slack_path); if (!free_mem_slack_s) { rc = libxl__fill_dom0_memory_info(gc, &target_memkb); - if (rc < 0) + if (rc <= 0) return rc; goto retry; } else { --Boundary-00=_kdVvMxW3R1WqzLt Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --Boundary-00=_kdVvMxW3R1WqzLt--