aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_netbsd.c
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2010-12-03 09:36:46 +0000
committerIan Campbell <ian.campbell@citrix.com>2010-12-03 09:36:46 +0000
commit2e04f9622fa58db6a5f4a1f8242877af25429db6 (patch)
treeb01ae067276a38086508d1e1ef647ed430879478 /tools/libxc/xc_netbsd.c
parent02e4f47747e6198c834017e5038fa6bf98a0cfeb (diff)
downloadxen-2e04f9622fa58db6a5f4a1f8242877af25429db6.tar.gz
xen-2e04f9622fa58db6a5f4a1f8242877af25429db6.tar.bz2
xen-2e04f9622fa58db6a5f4a1f8242877af25429db6.zip
libxc: osdep: convert do_xen_hypercall()
do_privcmd() was only ever used by do_xen_hypercall() so remove it. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Diffstat (limited to 'tools/libxc/xc_netbsd.c')
-rw-r--r--tools/libxc/xc_netbsd.c36
1 files changed, 15 insertions, 21 deletions
diff --git a/tools/libxc/xc_netbsd.c b/tools/libxc/xc_netbsd.c
index 397c4fb71f..3c3b90d178 100644
--- a/tools/libxc/xc_netbsd.c
+++ b/tools/libxc/xc_netbsd.c
@@ -68,6 +68,17 @@ static int netbsd_privcmd_close(xc_interface *xch, xc_osdep_handle h)
return close(fd);
}
+static int netbsd_privcmd_hypercall(xc_interface *xch, xc_osdep_handle h, privcmd_hypercall_t *hypercall)
+{
+ int fd = (int)h;
+ int error = ioctl(fd, IOCTL_PRIVCMD_HYPERCALL, hypercall);
+
+ if (error < 0)
+ return -errno;
+ else
+ return hypercall->retval;
+}
+
void *xc_map_foreign_batch(xc_interface *xch, uint32_t dom, int prot,
xen_pfn_t *arr, int num)
{
@@ -161,30 +172,13 @@ mmap_failed:
return NULL;
}
-
-static int do_privcmd(xc_interface *xch, unsigned int cmd, unsigned long data)
-{
- int err = ioctl(xch->fd, cmd, data);
- if (err == 0)
- return 0;
- else
- return -errno;
-}
-
-int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall)
-{
- int error = do_privcmd(xch,
- IOCTL_PRIVCMD_HYPERCALL,
- (unsigned long)hypercall);
- if (error)
- return error;
- else
- return (hypercall->retval);
-}
-
static struct xc_osdep_ops netbsd_privcmd_ops = {
.open = &netbsd_privcmd_open,
.close = &netbsd_privcmd_close,
+
+ .u.privcmd = {
+ .hypercall = &netbsd_privcmd_hypercall;
+ },
};
#define EVTCHN_DEV_NAME "/dev/xenevt"