]> xenbits.xensource.com Git - xen.git/commitdiff
libxc: Remove set_max_grants in linux
authorDaniel De Graaf <dgdegra@tycho.nsa.gov>
Mon, 17 Jan 2011 17:28:30 +0000 (17:28 +0000)
committerDaniel De Graaf <dgdegra@tycho.nsa.gov>
Mon, 17 Jan 2011 17:28:30 +0000 (17:28 +0000)
The maximum number of grants is now constrained domain-wide in linux,
so set_max_grants should be a noop there. Previously, this constraint
was per-file-description.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxc/xc_gnttab.c
tools/libxc/xc_linux_osdep.c

index ae152fd2a54381d39af7f21d97913c441cd82971..4f55fcef159a8c2cf576d5e0605fd38818378b1f 100644 (file)
@@ -184,6 +184,8 @@ int xc_gnttab_munmap(xc_gnttab *xcg,
 
 int xc_gnttab_set_max_grants(xc_gnttab *xcg, uint32_t count)
 {
+       if (!xcg->ops->u.gnttab.set_max_grants)
+               return 0;
        return xcg->ops->u.gnttab.set_max_grants(xcg, xcg->ops_handle, count);
 }
 
index fd2d8df35f8354cbff2107d107706468cca5ae95..377c93867a8c083790dd46e3ee8a5605931f6c9e 100644 (file)
@@ -627,19 +627,6 @@ static int linux_gnttab_munmap(xc_gnttab *xcg, xc_osdep_handle h,
     return 0;
 }
 
-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(fd, IOCTL_GNTDEV_SET_MAX_GRANTS, &set_max)) )
-        return rc;
-
-    return 0;
-}
-
 static struct xc_osdep_ops linux_gnttab_ops = {
     .open = &linux_gnttab_open,
     .close = &linux_gnttab_close,
@@ -649,7 +636,6 @@ static struct xc_osdep_ops linux_gnttab_ops = {
         .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,
     },
 };