diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2010-12-23 15:32:52 +0000 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2010-12-23 15:32:52 +0000 |
commit | 94705cc4bfe4d9d749d86f49045f62ed9e48a0bc (patch) | |
tree | 2ff00e7ac3769d5f695c5e7a2d7ddbf1060fa37d /tools/libxc/xc_minios.c | |
parent | 3e446a35ee82c738367e8f90e3bc9166687043a8 (diff) | |
download | xen-94705cc4bfe4d9d749d86f49045f62ed9e48a0bc.tar.gz xen-94705cc4bfe4d9d749d86f49045f62ed9e48a0bc.tar.bz2 xen-94705cc4bfe4d9d749d86f49045f62ed9e48a0bc.zip |
libxc: convert gnttab interfaces to use an opaque handle type
The xc_interface previously passed to xc_gnttab_* was only used for
logging which can now be done via the xc_gnttab handle instead.
This makes the interface consistent with the changes made to the main
interface in 21483:779c0ef9682c.
Also update QEMU_TAG to pull in the corresponding qemu change.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxc/xc_minios.c')
-rw-r--r-- | tools/libxc/xc_minios.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c index c8b0007ce6..d5f93f59ee 100644 --- a/tools/libxc/xc_minios.c +++ b/tools/libxc/xc_minios.c @@ -375,17 +375,17 @@ void discard_file_cache(xc_interface *xch, int fd, int flush) fsync(fd); } -int xc_gnttab_open(xc_interface *xch) +int xc_gnttab_open_core(xc_gnttab *xcg) { - int xcg_handle; - xcg_handle = alloc_fd(FTYPE_GNTMAP); - gntmap_init(&files[xcg_handle].gntmap); - return xcg_handle; + int fd; + fd = alloc_fd(FTYPE_GNTMAP); + gntmap_init(&files[fd].gntmap); + return fd; } -int xc_gnttab_close(xc_interface *xch, int xcg_handle) +int xc_gnttab_close_core(xc_gnttab *xcg) { - return close(xcg_handle); + return close(xcg->fd); } void minios_gnttab_close_fd(int fd) @@ -394,50 +394,50 @@ void minios_gnttab_close_fd(int fd) files[fd].type = FTYPE_NONE; } -void *xc_gnttab_map_grant_ref(xc_interface *xch, int xcg_handle, +void *xc_gnttab_map_grant_ref(xc_gnttab *xcg, uint32_t domid, uint32_t ref, int prot) { - return gntmap_map_grant_refs(&files[xcg_handle].gntmap, + return gntmap_map_grant_refs(&files[xcg->fd].gntmap, 1, &domid, 0, &ref, prot & PROT_WRITE); } -void *xc_gnttab_map_grant_refs(xc_interface *xch, int xcg_handle, +void *xc_gnttab_map_grant_refs(xc_gnttab *xcg, uint32_t count, uint32_t *domids, uint32_t *refs, int prot) { - return gntmap_map_grant_refs(&files[xcg_handle].gntmap, + return gntmap_map_grant_refs(&files[xcg->fd].gntmap, count, domids, 1, refs, prot & PROT_WRITE); } -void *xc_gnttab_map_domain_grant_refs(xc_interface *xch, int xcg_handle, +void *xc_gnttab_map_domain_grant_refs(xc_gnttab *xcg, uint32_t count, uint32_t domid, uint32_t *refs, int prot) { - return gntmap_map_grant_refs(&files[xcg_handle].gntmap, + return gntmap_map_grant_refs(&files[xcg->fd].gntmap, count, &domid, 0, refs, prot & PROT_WRITE); } -int xc_gnttab_munmap(xc_interface *xch, int xcg_handle, +int xc_gnttab_munmap(xc_gnttab *xcg, void *start_address, uint32_t count) { int ret; - ret = gntmap_munmap(&files[xcg_handle].gntmap, + ret = gntmap_munmap(&files[xcg->fd].gntmap, (unsigned long) start_address, count); if (ret < 0) { @@ -447,11 +447,11 @@ int xc_gnttab_munmap(xc_interface *xch, int xcg_handle, return ret; } -int xc_gnttab_set_max_grants(xc_interface *xch, int xcg_handle, +int xc_gnttab_set_max_grants(xc_gnttab *xcg, uint32_t count) { int ret; - ret = gntmap_set_max_grants(&files[xcg_handle].gntmap, + ret = gntmap_set_max_grants(&files[xcg->fd].gntmap, count); if (ret < 0) { errno = -ret; |