package mirage

  1. Overview
  2. Docs

Mirage keys.

Release v4.0.0

module Arg : sig ... end
include Functoria.KEY with module Arg := Arg
type 'a key = 'a Functoria__.Key.key
val create : string -> 'a Arg.t -> 'a key
type 'a value = 'a Functoria__.Key.value
val pure : 'a -> 'a value
val ($) : ('a -> 'b) value -> 'a value -> 'b value
val map : ('a -> 'b) -> 'a value -> 'b value
val if_ : bool value -> 'a -> 'a -> 'a value
val match_ : 'a value -> ('a -> 'b) -> 'b value
val default : 'a value -> 'a
val value : 'a key -> 'a value
type t = Functoria__.Key.t
val name : t -> string
val v : 'a key -> t
val equal : t -> t -> bool
val hash : t -> int
val compare : t -> t -> int
val pp : t Fmt.t
module Set : sig ... end
val of_deps : Set.t -> unit value
val deps : 'a value -> Set.t
val pp_deps : 'a value Fmt.t
val is_runtime : t -> bool
val is_configure : t -> bool
val filter_stage : Arg.stage -> Set.t -> Set.t
module Alias : sig ... end
val alias : string -> 'a Alias.t -> 'a key
val aliases : t -> Set.t
type context = Functoria__.Key.context
val dump_context : context Fmt.t
val empty_context : context
val merge_context : default:context -> context -> context
val add_to_context : 'a key -> 'a -> context -> context
val context : ?stage:Arg.stage -> with_required:bool -> Set.t -> context Cmdliner.Term.t
val mem : context -> 'a value -> bool
val peek : context -> 'a value -> 'a option
val eval : context -> 'a value -> 'a
val get : context -> 'a key -> 'a
val find : context -> 'a key -> 'a option
val pps : context -> Set.t Fmt.t
val ocaml_name : t -> string
val serialize_call : t Fmt.t
val serialize : context -> t Fmt.t
val module_name : string
val abstract : 'a key -> t
  • deprecated Use Mirage.Key.v.
type mode_unix = [
  1. | `Unix
  2. | `MacOSX
]
type mode_xen = [
  1. | `Xen
  2. | `Qubes
]
type mode_solo5 = [
  1. | `Hvt
  2. | `Spt
  3. | `Virtio
  4. | `Muen
  5. | `Genode
]
type mode = [
  1. | mode_unix
  2. | mode_xen
  3. | mode_solo5
]

Mirage keys

val target : mode key

-t TARGET: Key setting the configuration mode for the current project. Is one of "unix", "macosx", "xen", "qubes", "virtio", "hvt", "muen", "genode" or "spt".

val pp_target : mode Fmt.t

Pretty printer for the mode.

val is_unix : bool value

Is true iff the target key is a UNIXish system ("unix" or "macosx").

val is_solo5 : bool value

Is true iff the target key is a Solo5-based target.

val is_xen : bool value

Is true iff the target key is a Xen-based system ("xen" or "qubes").

val tracing_size : int -> int key

--tracing-size: Key setting the tracing ring buffer size.

OCaml runtime keys

The OCaml runtime is usually configurable via the OCAMLRUNPARAM environment variable. We provide boot parameters covering these options.

val backtrace : bool key

--backtrace: Output a backtrace if an uncaught exception terminated the unikernel.

val randomize_hashtables : bool key

--randomize-hashtables: Randomize all hash tables.

GC control

The OCaml garbage collector can be configured, as described in detail in GC control.

The following keys allow boot time configuration.

val allocation_policy : [ `Next_fit | `First_fit | `Best_fit ] key
val minor_heap_size : int option key
val major_heap_increment : int option key
val space_overhead : int option key
val max_space_overhead : int option key
val gc_verbosity : int option key
val gc_window_size : int option key
val custom_major_ratio : int option key
val custom_minor_ratio : int option key
val custom_minor_max_size : int option key

Generic keys

Some 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 keys

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".

val block : ?group:string -> unit -> [ `XenstoreId | `BlockFile | `Ramdisk ] key

Block device keys

PRNG key

val prng : [ `Stdlib | `Nocrypto ] key

The type of pseudo random number generator to use by default.

Stack keys

val dhcp : ?group:string -> unit -> bool key

Enable dhcp. Is either true or false.

val net : ?group:string -> unit -> [ `Direct | `Socket ] option key

The type of stack. Is either "direct" or "socket".

Network keys

val interface : ?group:string -> string -> string key

A network interface.

module V4 : sig ... end

Ipv4 keys.

module V6 : sig ... end

Ipv6 keys.

val ipv4_only : ?group:string -> unit -> bool key

An option for dual stack to only use IPv4.

val ipv6_only : ?group:string -> unit -> bool key

An option for dual stack to only use IPv6.

val resolver : ?default:Ipaddr.t -> unit -> Ipaddr.t option key

The address of the DNS resolver to use.

val resolver_port : ?default:int -> unit -> int key

The port of the DNS resolver.

val syslog : Ipaddr.t option -> Ipaddr.t option key

The address to send syslog frames to.

val syslog_port : int option -> int option key

The port to send syslog frames to.

val syslog_hostname : string -> string key

The hostname to use in syslog frames.

val logs : Mirage_runtime.log_threshold list key
OCaml

Innovation. Community. Security.