From: "Christoph Egger" Subject: [PATCH][TOOLS] libxc: make mmap() failure message more verbose Date: Thu, 29 Nov 2007 09:52:57 +0100 Message-ID: <200711290952.57505.Christoph.Egger@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Boundary-00=_p3nTH42OQtRe3Yh" Return-path: 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 List-Id: xen-devel@lists.xenproject.org --Boundary-00=_p3nTH42OQtRe3Yh Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi! Attached patch makes mmap() failure message more verbose. Signed-off-by: Christoph Egger =2D-=20 AMD Saxony, Dresden, Germany Operating System Research Center Legal Information: AMD Saxony Limited Liability Company & Co. KG Sitz (Gesch=E4ftsanschrift): Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland Registergericht Dresden: HRA 4896 vertretungsberechtigter Komplement=E4r: AMD Saxony LLC (Sitz Wilmington, Delaware, USA) Gesch=E4ftsf=FChrer der AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy --Boundary-00=_p3nTH42OQtRe3Yh Content-Type: text/plain; charset=us-ascii; name=xen_xc.diff Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=xen_xc.diff diff -r 26e766e0c628 tools/libxc/xc_dom_core.c --- a/tools/libxc/xc_dom_core.c Mon Nov 26 22:28:48 2007 +0000 +++ b/tools/libxc/xc_dom_core.c Thu Nov 29 11:56:01 2007 +0100 @@ -352,15 +352,19 @@ void *xc_dom_pfn_to_ptr(struct xc_dom_im } else { + int err; + mode = "anonymous memory"; phys->ptr = mmap(NULL, phys->count << page_shift, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); if ( phys->ptr == MAP_FAILED ) { + err = errno; xc_dom_panic(XC_OUT_OF_MEMORY, - "%s: oom: can't allocate 0x%" PRIpfn " pages\n", - __FUNCTION__, count); + "%s: oom: can't allocate 0x%" PRIpfn " pages" + " [mmap, errno=%i (%s)]\n", + __FUNCTION__, count, err, strerror(err)); return NULL; } dom->alloc_mem_map += phys->count << page_shift; --Boundary-00=_p3nTH42OQtRe3Yh 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=_p3nTH42OQtRe3Yh--