debuggers.hg
changeset 16426:e948f402c356
qemu: more verbose on failures.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
author | Keir Fraser <keir.fraser@citrix.com> |
---|---|
date | Fri Nov 16 17:03:46 2007 +0000 (2007-11-16) |
parents | 03d6d0f96e12 |
children | 270bd0fc3669 |
files | tools/libxc/xc_linux.c tools/libxc/xc_netbsd.c |
line diff
1.1 --- a/tools/libxc/xc_linux.c Fri Nov 16 17:01:50 2007 +0000 1.2 +++ b/tools/libxc/xc_linux.c Fri Nov 16 17:03:46 2007 +0000 1.3 @@ -67,8 +67,10 @@ void *xc_map_foreign_batch(int xc_handle 1.4 privcmd_mmapbatch_t ioctlx; 1.5 void *addr; 1.6 addr = mmap(NULL, num*PAGE_SIZE, prot, MAP_SHARED, xc_handle, 0); 1.7 - if ( addr == MAP_FAILED ) 1.8 + if ( addr == MAP_FAILED ) { 1.9 + perror("xc_map_foreign_batch: mmap failed"); 1.10 return NULL; 1.11 + } 1.12 1.13 ioctlx.num=num; 1.14 ioctlx.dom=dom; 1.15 @@ -77,7 +79,7 @@ void *xc_map_foreign_batch(int xc_handle 1.16 if ( ioctl(xc_handle, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx) < 0 ) 1.17 { 1.18 int saved_errno = errno; 1.19 - perror("XXXXXXXX"); 1.20 + perror("xc_map_foreign_batch: ioctl failed"); 1.21 (void)munmap(addr, num*PAGE_SIZE); 1.22 errno = saved_errno; 1.23 return NULL; 1.24 @@ -94,8 +96,10 @@ void *xc_map_foreign_range(int xc_handle 1.25 privcmd_mmap_entry_t entry; 1.26 void *addr; 1.27 addr = mmap(NULL, size, prot, MAP_SHARED, xc_handle, 0); 1.28 - if ( addr == MAP_FAILED ) 1.29 + if ( addr == MAP_FAILED ) { 1.30 + perror("xc_map_foreign_range: mmap failed"); 1.31 return NULL; 1.32 + } 1.33 1.34 ioctlx.num=1; 1.35 ioctlx.dom=dom; 1.36 @@ -106,6 +110,7 @@ void *xc_map_foreign_range(int xc_handle 1.37 if ( ioctl(xc_handle, IOCTL_PRIVCMD_MMAP, &ioctlx) < 0 ) 1.38 { 1.39 int saved_errno = errno; 1.40 + perror("xc_map_foreign_range: ioctl failed"); 1.41 (void)munmap(addr, size); 1.42 errno = saved_errno; 1.43 return NULL; 1.44 @@ -402,6 +407,7 @@ void *xc_gnttab_map_grant_ref(int xcg_ha 1.45 int saved_errno = errno; 1.46 struct ioctl_gntdev_unmap_grant_ref unmap_grant; 1.47 /* Unmap the driver slots used to store the grant information. */ 1.48 + perror("xc_gnttab_map_grant_ref: mmap failed"); 1.49 unmap_grant.index = map.index; 1.50 unmap_grant.count = 1; 1.51 ioctl(xcg_handle, IOCTL_GNTDEV_UNMAP_GRANT_REF, &unmap_grant); 1.52 @@ -445,6 +451,7 @@ void *xc_gnttab_map_grant_refs(int xcg_h 1.53 int saved_errno = errno; 1.54 struct ioctl_gntdev_unmap_grant_ref unmap_grant; 1.55 /* Unmap the driver slots used to store the grant information. */ 1.56 + perror("xc_gnttab_map_grant_refs: mmap failed"); 1.57 unmap_grant.index = map->index; 1.58 unmap_grant.count = count; 1.59 ioctl(xcg_handle, IOCTL_GNTDEV_UNMAP_GRANT_REF, &unmap_grant);
2.1 --- a/tools/libxc/xc_netbsd.c Fri Nov 16 17:01:50 2007 +0000 2.2 +++ b/tools/libxc/xc_netbsd.c Fri Nov 16 17:03:46 2007 +0000 2.3 @@ -63,8 +63,10 @@ void *xc_map_foreign_batch(int xc_handle 2.4 privcmd_mmapbatch_t ioctlx; 2.5 void *addr; 2.6 addr = mmap(NULL, num*PAGE_SIZE, prot, MAP_ANON | MAP_SHARED, -1, 0); 2.7 - if ( addr == MAP_FAILED ) 2.8 + if ( addr == MAP_FAILED ) { 2.9 + perror("xc_map_foreign_batch: mmap failed"); 2.10 return NULL; 2.11 + } 2.12 2.13 ioctlx.num=num; 2.14 ioctlx.dom=dom; 2.15 @@ -73,7 +75,7 @@ void *xc_map_foreign_batch(int xc_handle 2.16 if ( ioctl(xc_handle, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx) < 0 ) 2.17 { 2.18 int saved_errno = errno; 2.19 - perror("XXXXXXXX"); 2.20 + perror("xc_map_foreign_batch: ioctl failed"); 2.21 (void)munmap(addr, num*PAGE_SIZE); 2.22 errno = saved_errno; 2.23 return NULL; 2.24 @@ -90,8 +92,10 @@ void *xc_map_foreign_range(int xc_handle 2.25 privcmd_mmap_entry_t entry; 2.26 void *addr; 2.27 addr = mmap(NULL, size, prot, MAP_ANON | MAP_SHARED, -1, 0); 2.28 - if ( addr == MAP_FAILED ) 2.29 + if ( addr == MAP_FAILED ) { 2.30 + perror("xc_map_foreign_range: mmap failed"); 2.31 return NULL; 2.32 + } 2.33 2.34 ioctlx.num=1; 2.35 ioctlx.dom=dom; 2.36 @@ -102,6 +106,7 @@ void *xc_map_foreign_range(int xc_handle 2.37 if ( ioctl(xc_handle, IOCTL_PRIVCMD_MMAP, &ioctlx) < 0 ) 2.38 { 2.39 int saved_errno = errno; 2.40 + perror("xc_map_foreign_range: ioctl failed"); 2.41 (void)munmap(addr, size); 2.42 errno = saved_errno; 2.43 return NULL;