From f80309d43143c81de1261d669e8b995e171ea73a Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Tue, 31 Jan 2012 16:34:39 +0000 Subject: 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 Acked-by: Ian Jackson Committed-by: Ian Jackson --- tools/ocaml/libs/xl/xenlight.ml.in | 4 +--- tools/ocaml/libs/xl/xenlight.mli.in | 4 +--- tools/ocaml/libs/xl/xenlight_stubs.c | 19 ++----------------- 3 files changed, 4 insertions(+), 23 deletions(-) (limited to 'tools/ocaml') 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)); -- cgit v1.2.3