aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2010-12-03 09:36:47 +0000
committerIan Campbell <ian.campbell@citrix.com>2010-12-03 09:36:47 +0000
commitfa0eebfd1bd2a7eea7b6cb424a8d83cebfe6ee0b (patch)
tree547eac158516652f1da0e9d79b0a7bfd1f809df5 /tools/libxc
parente4371c99d8dcff34d8f2699e3cccbd80a0a24876 (diff)
downloadxen-fa0eebfd1bd2a7eea7b6cb424a8d83cebfe6ee0b.tar.gz
xen-fa0eebfd1bd2a7eea7b6cb424a8d83cebfe6ee0b.tar.bz2
xen-fa0eebfd1bd2a7eea7b6cb424a8d83cebfe6ee0b.zip
libxc: osdep: convert xc_gnttab_set_max_grants()
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Diffstat (limited to 'tools/libxc')
-rw-r--r--tools/libxc/xc_gnttab.c4
-rw-r--r--tools/libxc/xc_linux.c6
-rw-r--r--tools/libxc/xc_minios.c6
-rw-r--r--tools/libxc/xenctrlosdep.h1
4 files changed, 13 insertions, 4 deletions
diff --git a/tools/libxc/xc_gnttab.c b/tools/libxc/xc_gnttab.c
index eb78d01327..ae152fd2a5 100644
--- a/tools/libxc/xc_gnttab.c
+++ b/tools/libxc/xc_gnttab.c
@@ -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 --git a/tools/libxc/xc_linux.c b/tools/libxc/xc_linux.c
index 945b26f93d..7c62ee375e 100644
--- a/tools/libxc/xc_linux.c
+++ b/tools/libxc/xc_linux.c
@@ -653,13 +653,14 @@ static int linux_gnttab_munmap(xc_gnttab *xcg, xc_osdep_handle h,
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_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,
},
};
diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c
index c249f81cbe..2d5b43544c 100644
--- a/tools/libxc/xc_minios.c
+++ b/tools/libxc/xc_minios.c
@@ -504,11 +504,12 @@ static int minios_gnttab_munmap(xc_gnttab *xcg, xc_osdep_handle h,
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_ops = {
.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 --git a/tools/libxc/xenctrlosdep.h b/tools/libxc/xenctrlosdep.h
index 094d035045..d862fcff85 100644
--- a/tools/libxc/xenctrlosdep.h
+++ b/tools/libxc/xenctrlosdep.h
@@ -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;
};