diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2010-06-04 11:35:23 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2010-06-04 11:35:23 +0100 |
commit | 78c8506e77b393c00001fce9e8b21eda22ed3007 (patch) | |
tree | 389ca22b5b3f4cb280364e264beca2974ce4b924 /tools/libxc/xc_domain.c | |
parent | 77622d85cf3fd61e96b71750d75af58b60eddfc4 (diff) | |
download | xen-78c8506e77b393c00001fce9e8b21eda22ed3007.tar.gz xen-78c8506e77b393c00001fce9e8b21eda22ed3007.tar.bz2 xen-78c8506e77b393c00001fce9e8b21eda22ed3007.zip |
Watchdog timers for domains
Each domain is allowed to set, reset and disable its timers; when any
timer runs out the domain is killed.
Patch from Christian Limpach <Christian.Limpach@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Diffstat (limited to 'tools/libxc/xc_domain.c')
-rw-r--r-- | tools/libxc/xc_domain.c | 28 |
1 files changed, 28 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, |