aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_domain.c
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2010-10-22 15:14:51 +0100
committerIan Campbell <ian.campbell@citrix.com>2010-10-22 15:14:51 +0100
commit97feb4c2200f21b5ff9d3dd36cefbab691c809a9 (patch)
tree1f7df7f40c01d3e350ab831cfb2c0cc5d0df514f /tools/libxc/xc_domain.c
parentf90254ea2e5f0c96085a080db814abf05c417f9c (diff)
downloadxen-97feb4c2200f21b5ff9d3dd36cefbab691c809a9.tar.gz
xen-97feb4c2200f21b5ff9d3dd36cefbab691c809a9.tar.bz2
xen-97feb4c2200f21b5ff9d3dd36cefbab691c809a9.zip
libxc: convert schedop interfaces over to hypercall buffers
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Diffstat (limited to 'tools/libxc/xc_domain.c')
-rw-r--r--tools/libxc/xc_domain.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index e41f773745..df33f4d5c6 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -85,24 +85,25 @@ int xc_domain_shutdown(xc_interface *xch,
int reason)
{
int ret = -1;
- sched_remote_shutdown_t arg;
DECLARE_HYPERCALL;
+ DECLARE_HYPERCALL_BUFFER(sched_remote_shutdown_t, arg);
- hypercall.op = __HYPERVISOR_sched_op;
- hypercall.arg[0] = (unsigned long)SCHEDOP_remote_shutdown;
- hypercall.arg[1] = (unsigned long)&arg;
- arg.domain_id = domid;
- arg.reason = reason;
-
- if ( lock_pages(xch, &arg, sizeof(arg)) != 0 )
+ arg = xc_hypercall_buffer_alloc(xch, arg, sizeof(*arg));
+ if ( arg == NULL )
{
- PERROR("Could not lock memory for Xen hypercall");
+ PERROR("Could not allocate memory for xc_domain_shutdown hypercall");
goto out1;
}
+ hypercall.op = __HYPERVISOR_sched_op;
+ hypercall.arg[0] = (unsigned long)SCHEDOP_remote_shutdown;
+ hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+ arg->domain_id = domid;
+ arg->reason = reason;
+
ret = do_xen_hypercall(xch, &hypercall);
- unlock_pages(xch, &arg, sizeof(arg));
+ xc_hypercall_buffer_free(xch, arg);
out1:
return ret;