qemu: more verbose on failures.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
This commit is contained in:
Keir Fraser committed 2007-11-16 17:03:46 +00:00
1 parent cee481a4a0
commit 6d11c3493a
2 files changed
+18 -6

No files matched your search

+10 -3
View File
@@ -67,8 +67,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_SHARED, xc_handle, 0);
if ( addr == MAP_FAILED )
if ( addr == MAP_FAILED ) {
perror("xc_map_foreign_batch: mmap failed");
return NULL;
}
ioctlx.num=num;
ioctlx.dom=dom;
@@ -77,7 +79,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;
@@ -94,8 +96,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_SHARED, xc_handle, 0);
if ( addr == MAP_FAILED )
if ( addr == MAP_FAILED ) {
perror("xc_map_foreign_range: mmap failed");
return NULL;
}
ioctlx.num=1;
ioctlx.dom=dom;
@@ -106,6 +110,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;
@@ -402,6 +407,7 @@ void *xc_gnttab_map_grant_ref(int xcg_handle,
int saved_errno = errno;
struct ioctl_gntdev_unmap_grant_ref unmap_grant;
/* Unmap the driver slots used to store the grant information. */
perror("xc_gnttab_map_grant_ref: mmap failed");
unmap_grant.index = map.index;
unmap_grant.count = 1;
ioctl(xcg_handle, IOCTL_GNTDEV_UNMAP_GRANT_REF, &unmap_grant);
@@ -445,6 +451,7 @@ void *xc_gnttab_map_grant_refs(int xcg_handle,
int saved_errno = errno;
struct ioctl_gntdev_unmap_grant_ref unmap_grant;
/* Unmap the driver slots used to store the grant information. */
perror("xc_gnttab_map_grant_refs: mmap failed");
unmap_grant.index = map->index;
unmap_grant.count = count;
ioctl(xcg_handle, IOCTL_GNTDEV_UNMAP_GRANT_REF, &unmap_grant);
+8 -3
View File
@@ -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;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.