(* * Copyright (C) 2009-2011 Citrix Ltd. * Author Vincent Hanquez * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; version 2.1 only. with the special * exception on linking described in file LICENSE. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. *) type ctx type domid = int type devid = int (* @@LIBXL_TYPES@@ *) exception Error of (error * string) val register_exceptions: unit -> unit external ctx_alloc: Xentoollog.handle -> ctx = "stub_libxl_ctx_alloc" external test_raise_exception: unit -> unit = "stub_raise_exception" type event = | POLLIN (* There is data to read *) | POLLPRI (* There is urgent data to read *) | POLLOUT (* Writing now will not block *) | POLLERR (* Error condition (revents only) *) | POLLHUP (* Device has been disconnected (revents only) *) | POLLNVAL (* Invalid request: fd not open (revents only). *) module Domain : sig external create_new : ctx -> Domain_config.t -> ?async:'a -> unit -> domid = "stub_libxl_domain_create_new" external create_restore : ctx -> Domain_config.t -> (Unix.file_descr * Domain_restore_params.t) -> ?async:'a -> unit -> domid = "stub_libxl_domain_create_restore" external shutdown : ctx -> domid -> ?async:'a -> unit -> unit = "stub_libxl_domain_shutdown" external reboot : ctx -> domid -> ?async:'a -> unit -> unit = "stub_libxl_domain_reboot" external destroy : ctx -> domid -> ?async:'a -> unit -> unit = "stub_libxl_domain_destroy" external suspend : ctx -> domid -> Unix.file_descr -> ?async:'a -> unit -> unit = "stub_libxl_domain_suspend" external pause : ctx -> domid -> ?async:'a -> unit = "stub_libxl_domain_pause" external unpause : ctx -> domid -> ?async:'a -> unit = "stub_libxl_domain_unpause" external send_trigger : ctx -> domid -> trigger -> int -> ?async:'a -> unit = "stub_xl_send_trigger" external send_sysrq : ctx -> domid -> char -> unit = "stub_xl_send_sysrq" end module Host : sig type console_reader exception End_of_file external xen_console_read_start : ctx -> int -> console_reader = "stub_libxl_xen_console_read_start" external xen_console_read_line : ctx -> console_reader -> string = "stub_libxl_xen_console_read_line" external xen_console_read_finish : ctx -> console_reader -> unit = "stub_libxl_xen_console_read_finish" external send_debug_keys : ctx -> string -> unit = "stub_xl_send_debug_keys" end module Async : sig type for_libxl type event_hooks type osevent_hooks val osevent_register_hooks : ctx -> user:'a -> fd_register:('a -> Unix.file_descr -> event list -> for_libxl -> 'b) -> fd_modify:('a -> Unix.file_descr -> 'b -> event list -> 'b) -> fd_deregister:('a -> Unix.file_descr -> 'b -> unit) -> timeout_register:('a -> int64 -> int64 -> for_libxl -> 'c) -> timeout_fire_now:('a -> 'c -> 'c) -> osevent_hooks external osevent_occurred_fd : ctx -> for_libxl -> Unix.file_descr -> event list -> event list -> unit = "stub_libxl_osevent_occurred_fd" external osevent_occurred_timeout : ctx -> for_libxl -> unit = "stub_libxl_osevent_occurred_timeout" val async_register_callback : async_callback:(result:error option -> user:'a -> unit) -> unit external evenable_domain_death : ctx -> domid -> int -> unit = "stub_libxl_evenable_domain_death" val event_register_callbacks : ctx -> user:'a -> event_occurs_callback:('a -> Event.t -> unit) -> event_disaster_callback:('a -> event_type -> string -> int -> unit) -> event_hooks end