[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 18 of 25] libxc: osdep: convert xc_gnttab_set_max_grants()



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1291369007 0
# Node ID 384d9d7ca3063a32623cb0d6ccdbc258e3541749
# Parent  c5abbf2d6709770c039f2a01712986b1e37ec118
libxc: osdep: convert xc_gnttab_set_max_grants()

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

diff -r c5abbf2d6709 -r 384d9d7ca306 tools/libxc/xc_gnttab.c
--- a/tools/libxc/xc_gnttab.c   Fri Dec 03 09:36:47 2010 +0000
+++ b/tools/libxc/xc_gnttab.c   Fri Dec 03 09:36:47 2010 +0000
@@ -182,6 +182,10 @@ int xc_gnttab_munmap(xc_gnttab *xcg,
                                         start_address, count);
 }
 
+int xc_gnttab_set_max_grants(xc_gnttab *xcg, uint32_t count)
+{
+       return xcg->ops->u.gnttab.set_max_grants(xcg, xcg->ops_handle, count);
+}
 
 /*
  * Local variables:
diff -r c5abbf2d6709 -r 384d9d7ca306 tools/libxc/xc_linux.c
--- a/tools/libxc/xc_linux.c    Fri Dec 03 09:36:47 2010 +0000
+++ b/tools/libxc/xc_linux.c    Fri Dec 03 09:36:47 2010 +0000
@@ -653,13 +653,14 @@ static int linux_gnttab_munmap(xc_gnttab
     return 0;
 }
 
-int xc_gnttab_set_max_grants(xc_gnttab *xcg, uint32_t count)
+static int linux_gnttab_set_max_grants(xc_gnttab *xcg, xc_osdep_handle h, 
uint32_t count)
 {
+    int fd = (int)h;
     struct ioctl_gntdev_set_max_grants set_max;
     int rc;
 
     set_max.count = count;
-    if ( (rc = ioctl(xcg->fd, IOCTL_GNTDEV_SET_MAX_GRANTS, &set_max)) )
+    if ( (rc = ioctl(fd, IOCTL_GNTDEV_SET_MAX_GRANTS, &set_max)) )
         return rc;
 
     return 0;
@@ -674,6 +675,7 @@ static struct xc_osdep_ops linux_gnttab_
         .map_grant_refs = &linux_gnttab_map_grant_refs,
         .map_domain_grant_refs = &linux_gnttab_map_domain_grant_refs,
         .munmap = &linux_gnttab_munmap,
+        .set_max_grants = &linux_gnttab_set_max_grants,
     },
 };
 
diff -r c5abbf2d6709 -r 384d9d7ca306 tools/libxc/xc_minios.c
--- a/tools/libxc/xc_minios.c   Fri Dec 03 09:36:47 2010 +0000
+++ b/tools/libxc/xc_minios.c   Fri Dec 03 09:36:47 2010 +0000
@@ -504,11 +504,12 @@ static int minios_gnttab_munmap(xc_gntta
     return ret;
 }
 
-int xc_gnttab_set_max_grants(xc_gnttab *xcg,
+static int minios_gnttab_set_max_grants(xc_gnttab *xcg, xc_osdep_handle h,
                              uint32_t count)
 {
+    int fd = (int)h;
     int ret;
-    ret = gntmap_set_max_grants(&files[xcg->fd].gntmap,
+    ret = gntmap_set_max_grants(&files[fd].gntmap,
                                 count);
     if (ret < 0) {
         errno = -ret;
@@ -526,6 +527,7 @@ static struct xc_osdep_ops minios_gnttab
         .map_grant_refs = &minios_gnttab_map_grant_refs,
         .map_domain_grant_refs = &minios_gnttab_map_domain_grant_refs,
         .munmap = &minios_gnttab_munmap,
+        .set_max_grants = &minios_gnttab_set_max_grants,
     },
 };
 
diff -r c5abbf2d6709 -r 384d9d7ca306 tools/libxc/xenctrlosdep.h
--- a/tools/libxc/xenctrlosdep.h        Fri Dec 03 09:36:47 2010 +0000
+++ b/tools/libxc/xenctrlosdep.h        Fri Dec 03 09:36:47 2010 +0000
@@ -107,6 +107,7 @@ struct xc_osdep_ops
             int (*munmap)(xc_gnttab *xcg, xc_osdep_handle h,
                           void *start_address,
                           uint32_t count);
+            int (*set_max_grants)(xc_gnttab *xcg, xc_osdep_handle h, uint32_t 
count);
         } gnttab;
     } u;
 };

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.