# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1291369007 0
# Node ID 7a24de957ebbf9ac8681962c0e6dccf4c657a1dc
# Parent 8d07a123c875c57d0b1127d9a0cbd86c27c857d5
libxc: osdep: convert xc_evtchn_bind_interdomain()
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
diff -r 8d07a123c875 -r 7a24de957ebb tools/libxc/xc_evtchn.c
--- a/tools/libxc/xc_evtchn.c Fri Dec 03 09:36:47 2010 +0000
+++ b/tools/libxc/xc_evtchn.c Fri Dec 03 09:36:47 2010 +0000
@@ -94,6 +94,13 @@ xc_evtchn_bind_unbound_port(xc_evtchn *x
return xce->ops->u.evtchn.bind_unbound_port(xce, xce->ops_handle, domid);
}
+evtchn_port_or_error_t
+xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
+ evtchn_port_t remote_port)
+{
+ return xce->ops->u.evtchn.bind_interdomain(xce, xce->ops_handle, domid,
remote_port);
+}
+
/*
* Local variables:
* mode: C
diff -r 8d07a123c875 -r 7a24de957ebb tools/libxc/xc_linux.c
--- a/tools/libxc/xc_linux.c Fri Dec 03 09:36:47 2010 +0000
+++ b/tools/libxc/xc_linux.c Fri Dec 03 09:36:47 2010 +0000
@@ -386,16 +386,17 @@ linux_evtchn_bind_unbound_port(xc_evtchn
return ioctl(fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
}
-evtchn_port_or_error_t
-xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
- evtchn_port_t remote_port)
+static evtchn_port_or_error_t
+linux_evtchn_bind_interdomain(xc_evtchn *xce, xc_osdep_handle h, int domid,
+ evtchn_port_t remote_port)
{
+ int fd = (int)h;
struct ioctl_evtchn_bind_interdomain bind;
bind.remote_domain = domid;
bind.remote_port = remote_port;
- return ioctl(xce->fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
+ return ioctl(fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
}
evtchn_port_or_error_t
@@ -441,6 +442,7 @@ static struct xc_osdep_ops linux_evtchn_
.fd = &linux_evtchn_fd,
.notify = &linux_evtchn_notify,
.bind_unbound_port = &linux_evtchn_bind_unbound_port,
+ .bind_interdomain = &linux_evtchn_bind_interdomain,
},
};
diff -r 8d07a123c875 -r 7a24de957ebb tools/libxc/xc_minios.c
--- a/tools/libxc/xc_minios.c Fri Dec 03 09:36:47 2010 +0000
+++ b/tools/libxc/xc_minios.c Fri Dec 03 09:36:47 2010 +0000
@@ -302,27 +302,28 @@ static evtchn_port_or_error_t minios_evt
return port;
}
-evtchn_port_or_error_t xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
+static evtchn_port_or_error_t minios_evtchn_bind_interdomain(xc_evtchn *xce,
xc_osdep_handle h, int domid,
evtchn_port_t remote_port)
{
+ int fd = (int)h;
evtchn_port_t local_port;
int ret, i;
assert(get_current() == main_thread);
- i = port_alloc(xce->fd);
+ i = port_alloc(fd);
if (i == -1)
return -1;
printf("xc_evtchn_bind_interdomain(%d, %"PRId32")", domid, remote_port);
- ret = evtchn_bind_interdomain(domid, remote_port, evtchn_handler,
(void*)(intptr_t)xce->fd, &local_port);
+ ret = evtchn_bind_interdomain(domid, remote_port, evtchn_handler,
(void*)(intptr_t)fd, &local_port);
printf(" = %d\n", ret);
if (ret < 0) {
errno = -ret;
return -1;
}
- files[xce->fd].evtchn.ports[i].bound = 1;
- files[xce->fd].evtchn.ports[i].port = local_port;
+ files[fd].evtchn.ports[i].bound = 1;
+ files[fd].evtchn.ports[i].port = local_port;
unmask_evtchn(local_port);
return local_port;
}
@@ -406,6 +407,7 @@ static struct xc_osdep_ops minios_evtchn
.fd = &minios_evtchn_fd,
.notify = &minios_evtchn_notify,
.bind_unbound_port = &minios_evtchn_bind_unbound_port,
+ .bind_interdomain = &minios_evtchn_bind_interdomain,
},
};
diff -r 8d07a123c875 -r 7a24de957ebb tools/libxc/xc_netbsd.c
--- a/tools/libxc/xc_netbsd.c Fri Dec 03 09:36:47 2010 +0000
+++ b/tools/libxc/xc_netbsd.c Fri Dec 03 09:36:47 2010 +0000
@@ -241,17 +241,18 @@ netbsd_evtchn_bind_unbound_port(xc_evtch
return -1;
}
-evtchn_port_or_error_t
-xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
- evtchn_port_t remote_port)
+static evtchn_port_or_error_t
+netbsd_evtchn_bind_interdomain(xc_evtchn *xce, xc_osdep_handle h, int domid,
+ evtchn_port_t remote_port)
{
+ int fd = (int)h;
struct ioctl_evtchn_bind_interdomain bind;
int ret;
bind.remote_domain = domid;
bind.remote_port = remote_port;
- ret = ioctl(xce->fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
+ ret = ioctl(fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
if (ret == 0)
return bind.port;
else
@@ -306,6 +307,7 @@ static struct xc_osdep_ops netbsd_evtchn
.fd = &netbsd_evtchn_fd,
.notify = &netbsd_evtchn_notify,
.bind_unbound_port = &netbsd_evtchn_bind_unbound_port,
+ .bind_interdomain = &netbsd_evtchn_bind_interdomain,
},
};
diff -r 8d07a123c875 -r 7a24de957ebb tools/libxc/xc_solaris.c
--- a/tools/libxc/xc_solaris.c Fri Dec 03 09:36:47 2010 +0000
+++ b/tools/libxc/xc_solaris.c Fri Dec 03 09:36:47 2010 +0000
@@ -229,15 +229,16 @@ solaris_evtchn_bind_unbound_port(xc_evtc
}
evtchn_port_or_error_t
-xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
+solaris_evtchn_bind_interdomain(xc_evtchn *xce, xc_osdep_handle h, int domid,
evtchn_port_t remote_port)
{
+ int fd = (int)h;
struct ioctl_evtchn_bind_interdomain bind;
bind.remote_domain = domid;
bind.remote_port = remote_port;
- return ioctl(xce->fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
+ return ioctl(fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
}
evtchn_port_or_error_t
@@ -283,6 +284,7 @@ static struct xc_osdep_ops solaris_evtch
.fd = &solaris_evtchn_fd,
.notify = &solaris_evtchn_notify,
.bind_unbound_port = &solaris_evtchn_bind_unbound_port,
+ .bind_interdomain = &solaris_evtchn_bind_interdomain,
},
};
diff -r 8d07a123c875 -r 7a24de957ebb tools/libxc/xenctrlosdep.h
--- a/tools/libxc/xenctrlosdep.h Fri Dec 03 09:36:47 2010 +0000
+++ b/tools/libxc/xenctrlosdep.h Fri Dec 03 09:36:47 2010 +0000
@@ -80,6 +80,8 @@ struct xc_osdep_ops
int (*notify)(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t
port);
evtchn_port_or_error_t (*bind_unbound_port)(xc_evtchn *xce,
xc_osdep_handle h, int domid);
+ evtchn_port_or_error_t (*bind_interdomain)(xc_evtchn *xce,
xc_osdep_handle h, int domid,
+ evtchn_port_t
remote_port);
} evtchn;
} u;
};
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|