From 618a3fb38bcd860320faf8dbbe1b85c79fb34cb9 Mon Sep 17 00:00:00 2001 From: Daniel De Graaf Date: Mon, 17 Jan 2011 17:28:30 +0000 Subject: [PATCH] libxc: Remove set_max_grants in linux 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 Committed-by: Ian Jackson --- tools/libxc/xc_gnttab.c | 2 ++ tools/libxc/xc_linux_osdep.c | 14 -------------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/tools/libxc/xc_gnttab.c b/tools/libxc/xc_gnttab.c index ae152fd2a5..4f55fcef15 100644 --- a/tools/libxc/xc_gnttab.c +++ b/tools/libxc/xc_gnttab.c @@ -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); } diff --git a/tools/libxc/xc_linux_osdep.c b/tools/libxc/xc_linux_osdep.c index fd2d8df35f..377c93867a 100644 --- a/tools/libxc/xc_linux_osdep.c +++ b/tools/libxc/xc_linux_osdep.c @@ -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, }, }; -- 2.39.5