aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_netbsd.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2007-11-16 17:03:46 +0000
committerKeir Fraser <keir.fraser@citrix.com>2007-11-16 17:03:46 +0000
commit6d11c3493a4d8cc81ec9dc0f65a459bc45df676e (patch)
treea78c39de945093414bb2ac84e1eefebeb9fe6689 /tools/libxc/xc_netbsd.c
parentcee481a4a06bcfb86a2e6edb60f08791e1fa4202 (diff)
downloadxen-6d11c3493a4d8cc81ec9dc0f65a459bc45df676e.tar.gz
xen-6d11c3493a4d8cc81ec9dc0f65a459bc45df676e.tar.bz2
xen-6d11c3493a4d8cc81ec9dc0f65a459bc45df676e.zip
qemu: more verbose on failures.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Diffstat (limited to 'tools/libxc/xc_netbsd.c')
-rw-r--r--tools/libxc/xc_netbsd.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/libxc/xc_netbsd.c b/tools/libxc/xc_netbsd.c
index 0366dd294a..81c86d1064 100644
--- a/tools/libxc/xc_netbsd.c
+++ b/tools/libxc/xc_netbsd.c
@@ -63,8 +63,10 @@ void *xc_map_foreign_batch(int xc_handle, uint32_t dom, int prot,
privcmd_mmapbatch_t ioctlx;
void *addr;
addr = mmap(NULL, num*PAGE_SIZE, prot, MAP_ANON | MAP_SHARED, -1, 0);
- if ( addr == MAP_FAILED )
+ if ( addr == MAP_FAILED ) {
+ perror("xc_map_foreign_batch: mmap failed");
return NULL;
+ }
ioctlx.num=num;
ioctlx.dom=dom;
@@ -73,7 +75,7 @@ void *xc_map_foreign_batch(int xc_handle, uint32_t dom, int prot,
if ( ioctl(xc_handle, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx) < 0 )
{
int saved_errno = errno;
- perror("XXXXXXXX");
+ perror("xc_map_foreign_batch: ioctl failed");
(void)munmap(addr, num*PAGE_SIZE);
errno = saved_errno;
return NULL;
@@ -90,8 +92,10 @@ void *xc_map_foreign_range(int xc_handle, uint32_t dom,
privcmd_mmap_entry_t entry;
void *addr;
addr = mmap(NULL, size, prot, MAP_ANON | MAP_SHARED, -1, 0);
- if ( addr == MAP_FAILED )
+ if ( addr == MAP_FAILED ) {
+ perror("xc_map_foreign_range: mmap failed");
return NULL;
+ }
ioctlx.num=1;
ioctlx.dom=dom;
@@ -102,6 +106,7 @@ void *xc_map_foreign_range(int xc_handle, uint32_t dom,
if ( ioctl(xc_handle, IOCTL_PRIVCMD_MMAP, &ioctlx) < 0 )
{
int saved_errno = errno;
+ perror("xc_map_foreign_range: ioctl failed");
(void)munmap(addr, size);
errno = saved_errno;
return NULL;