Module Mirage_key Source Mirage keys.
Release v4.0.0
include Functoria.KEY with module Arg := Arg Configuration KeysThe type for configuration keys. Keys are used to retrieve the cross-stage values they are holding (by indexing contents in the autogenerated Bootgen_var module) but also to parameterize the choice of module implementation .
create n a is the key named n whose contents is determined by parsing the command-line argument a.
Configuration ValuesThe type for configure-time and run-time values. Values are either pure or obtained by composing other values. Values might have data dependencies , which form an (implicit) directed and acyclic graph that need to be evaluated.
pure x is a value without any dependency.
f $ v is is the value resulting from the application of f'value to v's value. $ is the usual app operator for applicative functor .
if_ v x y is map (fun b -> if b then x else y) v.
match_ v pattern is map pattern v.
default v returns the default value for v.
value k is the value parsed by k.
Abstract KeysThe type for abstract keys .
name t is the string given as t's name when t was created.
v k is the k with its type hidden.
equal is the equality function of untyped keys.
hash is the hash function for untyped keys.
compare compares untyped keys.
pp fmt k prints the name of k.
Set implements sets over t elements.
of_deps keys is a value with keys as data-dependencies.
deps v are v's data-dependencies.
pp_deps fmt v prints the name of the dependencies of v.
Stagesis_runtime k is true if k's stage is `Run or `Both.
is_configure k is true if k's stage is `Configure or `Both.
filter_stage s ks is ks but with only keys available at stage s.
Alias allows to define virtual keys in terms of other keys at configuration time only.
Similar to create but for command-line alias.
aliases t is the list of t's aliases.
Parsing contextThe type for values holding parsing context.
Source val context :
?stage :Arg.stage ->
with_required :bool ->
Set.t ->
context Cmdliner.Term.t context ~with_required ks is a Cmdliner term that evaluates into a parsing context for command-line arguments. If with_required is false, it will only produce optional keys.
mem c v is true iff all the dependencies of v have been evaluated.
peek c v is Some x if mem v and None otherwise.
eval c v evaluates v in c's context, using default values if necessary.
get c k is k's value in c's context. If k is not present in c, it is k's default value.
find c k is k's value in c's context or None if k is not present in c.
pps c fmt ks prints the keys ks using the context c to get their value.
Code Serializationocaml_name k is the ocaml name of k.
serialize_call fmt k outputs Key_gen.n () to fmt, where n is k's OCaml name .
serialize ctx ppf k outputs the Cmdliner runes to parse command-line arguments represented by k at runtime.
Source type mode_unix = [ | `Unix | `MacOSX ] Source type mode_xen = [ | `Xen | `Qubes ] Source type mode_solo5 = [ | `Hvt | `Spt | `Virtio | `Muen | `Genode ] Mirage keys-t TARGET: Key setting the configuration mode for the current project. Is one of "unix", "macosx", "xen", "qubes", "virtio", "hvt", "muen", "genode" or "spt".
Pretty printer for the mode.
Is true iff the target key is a UNIXish system ("unix" or "macosx").
Is true iff the target key is a Solo5-based target.
Is true iff the target key is a Xen-based system ("xen" or "qubes").
--tracing-size: Key setting the tracing ring buffer size.
OCaml runtime keysThe OCaml runtime is usually configurable via the OCAMLRUNPARAM environment variable. We provide boot parameters covering these options.
--backtrace: Output a backtrace if an uncaught exception terminated the unikernel.
--randomize-hashtables: Randomize all hash tables.
GC controlThe OCaml garbage collector can be configured, as described in detail in GC control .
The following keys allow boot time configuration.
Source val allocation_policy : [ `Next_fit | `First_fit | `Best_fit ] key Source val major_heap_increment : int option key Source val max_space_overhead : int option key Source val custom_major_ratio : int option key Source val custom_minor_ratio : int option key Source val custom_minor_max_size : int option key Generic keysSome keys have a group optional argument. This group argument allows to give several keys a prefix.
For example, if we have two ip stacks, one external and one internal, We can use the group option to name them in and out. This way, the available keys will be --in-ip and --out-ip.
If a key has another, non-optional argument. It is the default value.
Keys are always named the same as their command line option.
File system keysSource val kv_ro :
?group :string ->
unit ->
[ `Archive | `Crunch | `Direct | `Fat ] key The type of key value store. Is one of "archive", "crunch", "direct", or "fat".
Source val block :
?group :string ->
unit ->
[ `XenstoreId | `BlockFile | `Ramdisk ] key PRNG keyThe type of pseudo random number generator to use by default.
Stack keysSource val dhcp : ?group :string -> unit -> bool key Enable dhcp. Is either true or false.
Source val net : ?group :string -> unit -> [ `Direct | `Socket ] option key The type of stack. Is either "direct" or "socket".
Network keysSource val interface : ?group :string -> string -> string key Source val ipv4_only : ?group :string -> unit -> bool key An option for dual stack to only use IPv4.
Source val ipv6_only : ?group :string -> unit -> bool key An option for dual stack to only use IPv6.
The address of the DNS resolver to use.
Source val resolver_port : ?default :int -> unit -> int key The port of the DNS resolver.
The address to send syslog frames to.
Source val syslog_port : int option -> int option key The port to send syslog frames to.
Source val syslog_hostname : string -> string key The hostname to use in syslog frames.