WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] Support for -EAGAIN from xc_gnttab_map_gr

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Support for -EAGAIN from xc_gnttab_map_grant_ref.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 16 Dec 2009 22:41:27 -0800
Delivery-date: Wed, 16 Dec 2009 22:44:10 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1261031276 0
# Node ID fe42b16855aa727c36833f19df9ba0e7a163941e
# Parent  c344350672987de3d27f6d0b8ca75e1ac3882e52
Support for -EAGAIN from xc_gnttab_map_grant_ref.

Signed-off-by: Grzegorz Milos <Grzegorz.Milos@xxxxxxxxxx>
---
 tools/libxc/xc_linux.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletion(-)

diff -r c34435067298 -r fe42b16855aa tools/libxc/xc_linux.c
--- a/tools/libxc/xc_linux.c    Thu Dec 17 06:27:56 2009 +0000
+++ b/tools/libxc/xc_linux.c    Thu Dec 17 06:27:56 2009 +0000
@@ -442,13 +442,19 @@ void *xc_gnttab_map_grant_ref(int xcg_ha
     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;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Support for -EAGAIN from xc_gnttab_map_grant_ref., Xen patchbot-unstable <=