1(* SPDX-License-Identifier: LGPL-2.1-only WITH OCaml-LGPL-linking-exception *)
2
3(** To avoid breaking the plugin interface, this module needs to be
4    standalone and can't rely on any other Xen library. Even unrelated
5    changes in the interfaces of those modules would change the hash
6    of this interface and break the plugin system.
7    It can only depend on Stdlib, therefore all of the types (domid,
8    domaininfo etc.) are redefined here instead of using alternatives
9    defined elsewhere.
10
11    NOTE: The signature of this interface should not be changed (no
12    functions or types can be added, modified, or removed). If
13    underlying Xenctrl changes require a new interface, a V2 with a
14    corresponding plugin should be created.
15*)
16
17module type Domain_getinfo_V1 = sig
18  exception Error of string
19
20  type domid = int
21  type handle
22
23  type domaininfo = {
24    domid : domid;
25    dying : bool;
26    shutdown : bool;
27    shutdown_code : int;
28  }
29
30  val interface_open : unit -> handle
31  val domain_getinfo : handle -> domid -> domaininfo
32  val domain_getinfolist : handle -> domaininfo array
33end
34
35val register_logging_function : (string -> unit) -> unit
36val logging_function : (string -> unit) ref
37val register_plugin_v1 : (module Domain_getinfo_V1) -> unit
38val get_plugin_v1 : unit -> (module Domain_getinfo_V1)
39