aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-06-04 11:35:23 +0100
committerKeir Fraser <keir.fraser@citrix.com>2010-06-04 11:35:23 +0100
commit78c8506e77b393c00001fce9e8b21eda22ed3007 (patch)
tree389ca22b5b3f4cb280364e264beca2974ce4b924 /tools/libxc
parent77622d85cf3fd61e96b71750d75af58b60eddfc4 (diff)
downloadxen-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')
-rw-r--r--tools/libxc/xc_domain.c28
-rw-r--r--tools/libxc/xenctrl.h4
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,