[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-API] [PATCH] Add a method to trigger a power button push in a domain
# HG changeset patch # User Paul Durrant <paul.durrant@xxxxxxxxxx> # Date 1261498945 0 # Node ID aad2380e0a84178812a98ac2e902703eeb2e2d6e # Parent f90fee6d3af6f9fd1896e0b588143c0b229b0113 Add a method to trigger a power button push in a domain signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx> diff -r f90fee6d3af6 -r aad2380e0a84 domain-trigger-power --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/domain-trigger-power Tue Dec 22 16:22:25 2009 +0000 @@ -0,0 +1,76 @@ +diff -r f520cfefb3a7 xc/xc.h +--- a/xc/xc.h Tue Dec 22 10:02:15 2009 +0000 ++++ b/xc/xc.h Tue Dec 22 16:11:37 2009 +0000 +@@ -184,6 +184,7 @@ + int xc_domain_set_hpet(int handle, unsigned int domid, int hpet); + int xc_domain_set_timer_mode(int handle, unsigned int domid, int mode); + int xc_domain_get_acpi_s_state(int handle, unsigned int domid); ++int xc_domain_trigger_power(int handle, unsigned int domid); + + #if XEN_SYSCTL_INTERFACE_VERSION >= 6 + #define SAFEDIV(a, b) (((b) >= 0) ? (a) / (b) : (a)) +diff -r f520cfefb3a7 xc/xc.ml +--- a/xc/xc.ml Tue Dec 22 10:02:15 2009 +0000 ++++ b/xc/xc.ml Tue Dec 22 16:11:37 2009 +0000 +@@ -253,6 +253,8 @@ + external domain_send_s3resume: handle -> domid -> unit = "stub_xc_domain_send_s3resume" + external domain_get_acpi_s_state: handle -> domid -> int = "stub_xc_domain_get_acpi_s_state" + ++external domain_trigger_power: handle -> domid -> unit = "stub_xc_domain_trigger_power" ++ + (** check if some hvm domain got pv driver or not *) + external hvm_check_pvdriver: handle -> domid -> bool + = "stub_xc_hvm_check_pvdriver" +diff -r f520cfefb3a7 xc/xc.mli +--- a/xc/xc.mli Tue Dec 22 10:02:15 2009 +0000 ++++ b/xc/xc.mli Tue Dec 22 16:11:37 2009 +0000 +@@ -166,6 +166,9 @@ + = "stub_xc_domain_send_s3resume" + external domain_get_acpi_s_state: handle -> domid -> int = "stub_xc_domain_get_acpi_s_state" + ++external domain_trigger_power: handle -> domid -> unit ++ = "stub_xc_domain_trigger_power" ++ + external hvm_check_pvdriver : handle -> domid -> bool + = "stub_xc_hvm_check_pvdriver" + external version : handle -> version = "stub_xc_version_version" +diff -r f520cfefb3a7 xc/xc_lib.c +--- a/xc/xc_lib.c Tue Dec 22 10:02:15 2009 +0000 ++++ b/xc/xc_lib.c Tue Dec 22 16:11:37 2009 +0000 +@@ -1549,6 +1549,19 @@ + return rc; + } + ++int xc_domain_trigger_power(int handle, unsigned int domid) ++{ ++ int ret; ++ ++ DECLARE_DOMCTL(XEN_DOMCTL_sendtrigger, domid); ++ domctl.u.sendtrigger.trigger = XEN_DOMCTL_SENDTRIGGER_POWER; ++ ++ ret = do_domctl(handle, &domctl); ++ if (ret != 0) ++ xc_error_set("power button failed: %s", xc_error_get()); ++ return ret; ++} ++ + /* + * Local variables: + * indent-tabs-mode: t +diff -r f520cfefb3a7 xc/xc_stubs.c +--- a/xc/xc_stubs.c Tue Dec 22 10:02:15 2009 +0000 ++++ b/xc/xc_stubs.c Tue Dec 22 16:11:37 2009 +0000 +@@ -1209,6 +1209,13 @@ + CAMLreturn(Val_unit); + } + ++CAMLprim value stub_xc_domain_trigger_power(value handle, value domid) ++{ ++ CAMLparam2(handle, domid); ++ xc_domain_trigger_power(_H(handle), _D(domid)); ++ CAMLreturn(Val_unit); ++} ++ + /* + * Local variables: + * indent-tabs-mode: t diff -r f90fee6d3af6 -r aad2380e0a84 series --- a/series Mon Dec 21 18:17:38 2009 +0000 +++ b/series Tue Dec 22 16:22:25 2009 +0000 @@ -1,1 +1,2 @@ dummy +domain-trigger-power _______________________________________________ xen-api mailing list xen-api@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/mailman/listinfo/xen-api
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |