[xen-unstable] domain builder: make mmap() failure message more verbose.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen-unstable] domain builder: make mmap() failure message more verbose.

Xen patchbot-unstable
# HG changeset patch
# User Keir Fraser <[hidden email]>
# Date 1196763184 0
# Node ID 6e7cf648f7f3486e532be332bb4d832bbfe9784a
# Parent  01faea565a9b24c819a25fdcf444cd65fc1932f2
domain builder: make mmap() failure message more verbose.
Signed-off-by: Christoph Egger <[hidden email]>
---
 tools/libxc/xc_dom_core.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff -r 01faea565a9b -r 6e7cf648f7f3 tools/libxc/xc_dom_core.c
--- a/tools/libxc/xc_dom_core.c Tue Dec 04 10:11:54 2007 +0000
+++ b/tools/libxc/xc_dom_core.c Tue Dec 04 10:13:04 2007 +0000
@@ -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;

_______________________________________________
Xen-changelog mailing list
[hidden email]
http://lists.xensource.com/xen-changelog