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
commit9292c94f007458064784b94b901accc7b3ec27d9 (patch)
tree39265ee232dc50b6808ad6828417da83cc45d922 /tools/libxc/xc_domain.c
parent4513025a87902aa4469b15e8097beb7590da7b78 (diff)
downloadxen-9292c94f007458064784b94b901accc7b3ec27d9.tar.gz
xen-9292c94f007458064784b94b901accc7b3ec27d9.tar.bz2
xen-9292c94f007458064784b94b901accc7b3ec27d9.zip
libxc: convert watchdog interface 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 aada28bbde..e41f773745 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -374,24 +374,25 @@ int xc_watchdog(xc_interface *xch,
uint32_t timeout)
{
int ret = -1;
- sched_watchdog_t arg;
DECLARE_HYPERCALL;
+ DECLARE_HYPERCALL_BUFFER(sched_watchdog_t, arg);
- hypercall.op = __HYPERVISOR_sched_op;
- hypercall.arg[0] = (unsigned long)SCHEDOP_watchdog;
- hypercall.arg[1] = (unsigned long)&arg;
- arg.id = id;
- arg.timeout = timeout;
-
- 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_watchdog hypercall");
goto out1;
}
+ hypercall.op = __HYPERVISOR_sched_op;
+ hypercall.arg[0] = (unsigned long)SCHEDOP_watchdog;
+ hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+ arg->id = id;
+ arg->timeout = timeout;
+
ret = do_xen_hypercall(xch, &hypercall);
- unlock_pages(xch, &arg, sizeof(arg));
+ xc_hypercall_buffer_free(xch, arg);
out1:
return ret;