From 21fadf30af1418207dcdb8340674aa2e6730c164 Mon Sep 17 00:00:00 2001 From: David Scott Date: Wed, 30 Mar 2011 18:54:28 +0100 Subject: [PATCH] tools: ocaml: rename the console types and functions The aims are: 1. make the records instantiable if they have field names in common; and 2. to make it easier to derive the names programatically from the IDL Signed-off-by: David Scott Signed-off-by: Ian Campbell Acked-by: Ian Jackson Committed-by: Ian Jackson --- tools/ocaml/libs/xl/xl.ml | 18 ++++++++++-------- tools/ocaml/libs/xl/xl.mli | 18 ++++++++++-------- tools/ocaml/libs/xl/xl_stubs.c | 2 +- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/tools/ocaml/libs/xl/xl.ml b/tools/ocaml/libs/xl/xl.ml index 1be9efe657..a6024728c6 100644 --- a/tools/ocaml/libs/xl/xl.ml +++ b/tools/ocaml/libs/xl/xl.ml @@ -123,12 +123,16 @@ type console_type = | CONSOLETYPE_XENCONSOLED | CONSOLETYPE_IOEMU -type console_info = -{ - backend_domid : domid; - devid : int; - consoletype : console_type; -} +module Device_console = struct + type t = + { + backend_domid : domid; + devid : int; + consoletype : console_type; + } + + external add : t -> build_state -> domid -> unit = "stub_xl_device_console_add" +end type vkb_info = { @@ -196,8 +200,6 @@ type sched_credit = external domain_make : create_info -> domid = "stub_xl_domain_make" external domain_build : build_info -> domid -> build_state = "stub_xl_domain_build" -external console_add : console_info -> build_state -> domid -> unit = "stub_xl_console_add" - external vkb_add : vkb_info -> domid -> unit = "stub_xl_vkb_add" external vkb_clean_shutdown : domid -> unit = "stub_vkb_clean_shutdown" external vkb_hard_shutdown : domid -> unit = "stub_vkb_hard_shutdown" diff --git a/tools/ocaml/libs/xl/xl.mli b/tools/ocaml/libs/xl/xl.mli index 11fc1c132e..cf77e1d520 100644 --- a/tools/ocaml/libs/xl/xl.mli +++ b/tools/ocaml/libs/xl/xl.mli @@ -123,12 +123,16 @@ type console_type = | CONSOLETYPE_XENCONSOLED | CONSOLETYPE_IOEMU -type console_info = -{ - backend_domid : domid; - devid : int; - consoletype : console_type; -} +module Device_console : sig + type t = + { + backend_domid : domid; + devid : int; + consoletype : console_type; + } + + external add : t -> build_state -> domid -> unit = "stub_xl_device_console_add" +end type vkb_info = { @@ -196,8 +200,6 @@ type sched_credit = external domain_make : create_info -> domid = "stub_xl_domain_make" external domain_build : build_info -> domid -> build_state = "stub_xl_domain_build" -external console_add : console_info -> build_state -> domid -> unit = "stub_xl_console_add" - external vkb_add : vkb_info -> domid -> unit = "stub_xl_vkb_add" external vkb_clean_shutdown : domid -> unit = "stub_vkb_clean_shutdown" external vkb_hard_shutdown : domid -> unit = "stub_vkb_hard_shutdown" diff --git a/tools/ocaml/libs/xl/xl_stubs.c b/tools/ocaml/libs/xl/xl_stubs.c index 692bf071f6..3ded26ee75 100644 --- a/tools/ocaml/libs/xl/xl_stubs.c +++ b/tools/ocaml/libs/xl/xl_stubs.c @@ -436,7 +436,7 @@ value stub_xl_device_nic_del(value info, value domid) CAMLreturn(Val_unit); } -value stub_xl_console_add(value info, value state, value domid) +value stub_xl_device_console_add(value info, value state, value domid) { CAMLparam3(info, state, domid); libxl_device_console c_info; -- 2.39.5