aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_linux.c
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2010-12-23 15:25:57 +0000
committerIan Campbell <ian.campbell@citrix.com>2010-12-23 15:25:57 +0000
commit3e446a35ee82c738367e8f90e3bc9166687043a8 (patch)
treed2ed5fd210a798cb5c54007a08e8bd2b9e9a221f /tools/libxc/xc_linux.c
parent252cb308e37470915d0f64c730e4e2e829ec2512 (diff)
downloadxen-3e446a35ee82c738367e8f90e3bc9166687043a8.tar.gz
xen-3e446a35ee82c738367e8f90e3bc9166687043a8.tar.bz2
xen-3e446a35ee82c738367e8f90e3bc9166687043a8.zip
libxc: convert evtchn interfaces to use an opaque handle type
This makes the interface consistent with the changes made to the main interface in 21483:779c0ef9682c. Also fix some references to "struct xc_interface" which should have been simply "xc_interface" in tools/xenpaging, and 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_linux.c')
-rw-r--r--tools/libxc/xc_linux.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/tools/libxc/xc_linux.c b/tools/libxc/xc_linux.c
index 63b89b4786..f2a24c3ab5 100644
--- a/tools/libxc/xc_linux.c
+++ b/tools/libxc/xc_linux.c
@@ -68,9 +68,9 @@ int xc_interface_open_core(xc_interface *xch)
return -1;
}
-int xc_interface_close_core(xc_interface *xch, int fd)
+int xc_interface_close_core(xc_interface *xch)
{
- return close(fd);
+ return close(xch->fd);
}
static int xc_map_foreign_batch_single(xc_interface *xch, uint32_t dom,
@@ -327,42 +327,42 @@ int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall)
#define DEVXEN "/dev/xen/"
-int xc_evtchn_open(void)
+int xc_evtchn_open_core(xc_evtchn *xce)
{
return open(DEVXEN "evtchn", O_RDWR);
}
-int xc_evtchn_close(int xce_handle)
+int xc_evtchn_close_core(xc_evtchn *xce)
{
- return close(xce_handle);
+ return close(xce->fd);
}
-int xc_evtchn_fd(int xce_handle)
+int xc_evtchn_fd(xc_evtchn *xce)
{
- return xce_handle;
+ return xce->fd;
}
-int xc_evtchn_notify(int xce_handle, evtchn_port_t port)
+int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
{
struct ioctl_evtchn_notify notify;
notify.port = port;
- return ioctl(xce_handle, IOCTL_EVTCHN_NOTIFY, &notify);
+ return ioctl(xce->fd, IOCTL_EVTCHN_NOTIFY, &notify);
}
evtchn_port_or_error_t
-xc_evtchn_bind_unbound_port(int xce_handle, int domid)
+xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid)
{
struct ioctl_evtchn_bind_unbound_port bind;
bind.remote_domain = domid;
- return ioctl(xce_handle, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
+ return ioctl(xce->fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
}
evtchn_port_or_error_t
-xc_evtchn_bind_interdomain(int xce_handle, int domid,
+xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
evtchn_port_t remote_port)
{
struct ioctl_evtchn_bind_interdomain bind;
@@ -370,42 +370,42 @@ xc_evtchn_bind_interdomain(int xce_handle, int domid,
bind.remote_domain = domid;
bind.remote_port = remote_port;
- return ioctl(xce_handle, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
+ return ioctl(xce->fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
}
evtchn_port_or_error_t
-xc_evtchn_bind_virq(int xce_handle, unsigned int virq)
+xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
{
struct ioctl_evtchn_bind_virq bind;
bind.virq = virq;
- return ioctl(xce_handle, IOCTL_EVTCHN_BIND_VIRQ, &bind);
+ return ioctl(xce->fd, IOCTL_EVTCHN_BIND_VIRQ, &bind);
}
-int xc_evtchn_unbind(int xce_handle, evtchn_port_t port)
+int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port)
{
struct ioctl_evtchn_unbind unbind;
unbind.port = port;
- return ioctl(xce_handle, IOCTL_EVTCHN_UNBIND, &unbind);
+ return ioctl(xce->fd, IOCTL_EVTCHN_UNBIND, &unbind);
}
evtchn_port_or_error_t
-xc_evtchn_pending(int xce_handle)
+xc_evtchn_pending(xc_evtchn *xce)
{
evtchn_port_t port;
- if ( read_exact(xce_handle, (char *)&port, sizeof(port)) == -1 )
+ if ( read_exact(xce->fd, (char *)&port, sizeof(port)) == -1 )
return -1;
return port;
}
-int xc_evtchn_unmask(int xce_handle, evtchn_port_t port)
+int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port)
{
- return write_exact(xce_handle, (char *)&port, sizeof(port));
+ return write_exact(xce->fd, (char *)&port, sizeof(port));
}
/* Optionally flush file to disk and discard page cache */