aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_linux.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-12-17 06:27:56 +0000
committerKeir Fraser <keir.fraser@citrix.com>2009-12-17 06:27:56 +0000
commit7e31226c7a62a1b88727b9e718eb11b745de16ab (patch)
tree43696347e078596fd833b874718d65d3d6fd3577 /tools/libxc/xc_linux.c
parent40be3d02f08b53726568ce702b227f33b63afd31 (diff)
downloadxen-7e31226c7a62a1b88727b9e718eb11b745de16ab.tar.gz
xen-7e31226c7a62a1b88727b9e718eb11b745de16ab.tar.bz2
xen-7e31226c7a62a1b88727b9e718eb11b745de16ab.zip
Support for -EAGAIN from xc_gnttab_map_grant_ref.
Signed-off-by: Grzegorz Milos <Grzegorz.Milos@citrix.com>
Diffstat (limited to 'tools/libxc/xc_linux.c')
-rw-r--r--tools/libxc/xc_linux.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/libxc/xc_linux.c b/tools/libxc/xc_linux.c
index de176fbb8b..0f1b78aa57 100644
--- a/tools/libxc/xc_linux.c
+++ b/tools/libxc/xc_linux.c
@@ -442,13 +442,19 @@ void *xc_gnttab_map_grant_ref(int xcg_handle, uint32_t domid, uint32_t ref,
if ( ioctl(xcg_handle, IOCTL_GNTDEV_MAP_GRANT_REF, &map) )
return NULL;
+mmap_again:
addr = mmap(NULL, PAGE_SIZE, prot, MAP_SHARED, xcg_handle, map.index);
if ( addr == MAP_FAILED )
{
int saved_errno = errno;
struct ioctl_gntdev_unmap_grant_ref unmap_grant;
- /* Unmap the driver slots used to store the grant information. */
+ if(saved_errno == EAGAIN)
+ {
+ usleep(1000);
+ goto mmap_again;
+ }
+ /* 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;