aboutsummaryrefslogtreecommitdiffstats
path: root/tools/ocaml
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2012-01-31 16:34:39 +0000
committerIan Campbell <ian.campbell@citrix.com>2012-01-31 16:34:39 +0000
commitf80309d43143c81de1261d669e8b995e171ea73a (patch)
treeed53a0fab5035bab1031df2f81ffbf96958ccac5 /tools/ocaml
parentea81e4fdbffd2a7abf40458e40041ad185ede8a1 (diff)
downloadxen-f80309d43143c81de1261d669e8b995e171ea73a.tar.gz
xen-f80309d43143c81de1261d669e8b995e171ea73a.tar.bz2
xen-f80309d43143c81de1261d669e8b995e171ea73a.zip
libxl: remove libxl_button_press in favour of libxl_send_trigger.
send_trigger already included all the operations covered by button_press. Rework send_trigger to take an enum instead of a string. I stopped short at removing the xl "button-press" command but instead have marked it as deprecated. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Diffstat (limited to 'tools/ocaml')
-rw-r--r--tools/ocaml/libs/xl/xenlight.ml.in4
-rw-r--r--tools/ocaml/libs/xl/xenlight.mli.in4
-rw-r--r--tools/ocaml/libs/xl/xenlight_stubs.c19
3 files changed, 4 insertions, 23 deletions
diff --git a/tools/ocaml/libs/xl/xenlight.ml.in b/tools/ocaml/libs/xl/xenlight.ml.in
index f4bba86837..bf7a45080c 100644
--- a/tools/ocaml/libs/xl/xenlight.ml.in
+++ b/tools/ocaml/libs/xl/xenlight.ml.in
@@ -29,10 +29,8 @@ module Topologyinfo = struct
external get : unit -> t = "stub_xl_topologyinfo"
end
-external button_press : domid -> button -> unit = "stub_xl_button_press"
-
-external send_trigger : domid -> string -> int -> unit = "stub_xl_send_trigger"
+external send_trigger : domid -> trigger -> int -> unit = "stub_xl_send_trigger"
external send_sysrq : domid -> char -> unit = "stub_xl_send_sysrq"
external send_debug_keys : domid -> string -> unit = "stub_xl_send_debug_keys"
diff --git a/tools/ocaml/libs/xl/xenlight.mli.in b/tools/ocaml/libs/xl/xenlight.mli.in
index 2b169a085e..7006b2a145 100644
--- a/tools/ocaml/libs/xl/xenlight.mli.in
+++ b/tools/ocaml/libs/xl/xenlight.mli.in
@@ -29,8 +29,6 @@ module Topologyinfo : sig
external get : unit -> t = "stub_xl_topologyinfo"
end
-external button_press : domid -> button -> unit = "stub_xl_button_press"
-
-external send_trigger : domid -> string -> int -> unit = "stub_xl_send_trigger"
+external send_trigger : domid -> trigger -> int -> unit = "stub_xl_send_trigger"
external send_sysrq : domid -> char -> unit = "stub_xl_send_sysrq"
external send_debug_keys : domid -> string -> unit = "stub_xl_send_debug_keys"
diff --git a/tools/ocaml/libs/xl/xenlight_stubs.c b/tools/ocaml/libs/xl/xenlight_stubs.c
index 59329f184f..4b19e9a858 100644
--- a/tools/ocaml/libs/xl/xenlight_stubs.c
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c
@@ -432,21 +432,6 @@ value stub_xl_device_pci_remove(value info, value domid)
CAMLreturn(Val_unit);
}
-value stub_xl_button_press(value domid, value button)
-{
- CAMLparam2(domid, button);
- int ret;
- INIT_STRUCT();
-
- INIT_CTX();
- ret = libxl_button_press(ctx, Int_val(domid), Int_val(button) + LIBXL_BUTTON_POWER);
- if (ret != 0)
- failwith_xl("button_press", &lg);
- FREE_CTX();
-
- CAMLreturn(Val_unit);
-}
-
value stub_xl_physinfo_get(value unit)
{
CAMLparam1(unit);
@@ -523,10 +508,10 @@ value stub_xl_send_trigger(value domid, value trigger, value vcpuid)
{
CAMLparam3(domid, trigger, vcpuid);
int ret;
- char *c_trigger;
+ libxl_trigger c_trigger = LIBXL_TRIGGER_UNKNOWN;
INIT_STRUCT();
- c_trigger = dup_String_val(&gc, trigger);
+ trigger_val(&gc, &lg, &c_trigger, trigger);
INIT_CTX();
ret = libxl_send_trigger(ctx, Int_val(domid), c_trigger, Int_val(vcpuid));