ia64/xen-unstable

changeset 16506:6e7cf648f7f3

domain builder: make mmap() failure message more verbose.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Dec 04 10:13:04 2007 +0000 (2007-12-04)
parents 01faea565a9b
children 190c2592247d
files tools/libxc/xc_dom_core.c
line diff
     1.1 --- a/tools/libxc/xc_dom_core.c	Tue Dec 04 10:11:54 2007 +0000
     1.2 +++ b/tools/libxc/xc_dom_core.c	Tue Dec 04 10:13:04 2007 +0000
     1.3 @@ -352,15 +352,19 @@ void *xc_dom_pfn_to_ptr(struct xc_dom_im
     1.4      }
     1.5      else
     1.6      {
     1.7 +        int err;
     1.8 +
     1.9          mode = "anonymous memory";
    1.10          phys->ptr = mmap(NULL, phys->count << page_shift,
    1.11                           PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON,
    1.12                           -1, 0);
    1.13          if ( phys->ptr == MAP_FAILED )
    1.14          {
    1.15 +            err = errno;
    1.16              xc_dom_panic(XC_OUT_OF_MEMORY,
    1.17 -                         "%s: oom: can't allocate 0x%" PRIpfn " pages\n",
    1.18 -                         __FUNCTION__, count);
    1.19 +                         "%s: oom: can't allocate 0x%" PRIpfn " pages"
    1.20 +                         " [mmap, errno=%i (%s)]\n",
    1.21 +                         __FUNCTION__, count, err, strerror(err));
    1.22              return NULL;
    1.23          }
    1.24          dom->alloc_mem_map += phys->count << page_shift;