diff options
Diffstat (limited to 'tools/libxc')
-rw-r--r-- | tools/libxc/xc_domain.c | 28 | ||||
-rw-r--r-- | tools/libxc/xenctrl.h | 4 |
2 files changed, 32 insertions, 0 deletions
diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c index ae323fe854..e89b738c75 100644 --- a/tools/libxc/xc_domain.c +++ b/tools/libxc/xc_domain.c @@ -366,6 +366,34 @@ int xc_vcpu_getcontext(xc_interface *xch, return rc; } +int xc_watchdog(xc_interface *xch, + uint32_t id, + uint32_t timeout) +{ + int ret = -1; + sched_watchdog_t arg; + DECLARE_HYPERCALL; + + 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(&arg, sizeof(arg)) != 0 ) + { + PERROR("Could not lock memory for Xen hypercall"); + goto out1; + } + + ret = do_xen_hypercall(xch, &hypercall); + + unlock_pages(&arg, sizeof(arg)); + + out1: + return ret; +} + int xc_shadow_control(xc_interface *xch, uint32_t domid, diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h index 4bcf29d979..705df1d2ff 100644 --- a/tools/libxc/xenctrl.h +++ b/tools/libxc/xenctrl.h @@ -332,6 +332,10 @@ int xc_domain_shutdown(xc_interface *xch, uint32_t domid, int reason); +int xc_watchdog(xc_interface *xch, + uint32_t id, + uint32_t timeout); + int xc_vcpu_setaffinity(xc_interface *xch, uint32_t domid, int vcpu, |