`sig
type uuid = string
type xml = string
type filename = string
val get_version : ?driver:string -> unit -> int * int
val uuid_length : int
val uuid_string_length : int
type rw = [ `R | `W ]
type ro = [ `R ]
module Connect :
sig
type 'rw t
type node_info = {
model : string;
memory : int64;
cpus : int;
mhz : int;
nodes : int;
sockets : int;
cores : int;
threads : int;
}
val connect : ?name:string -> unit -> Libvirt.rw Libvirt.Connect.t
val connect_readonly :
?name:string -> unit -> Libvirt.ro Libvirt.Connect.t
val close : [> `R ] Libvirt.Connect.t -> unit
val get_type : [> `R ] Libvirt.Connect.t -> string
val get_version : [> `R ] Libvirt.Connect.t -> int
val get_hostname : [> `R ] Libvirt.Connect.t -> string
val get_uri : [> `R ] Libvirt.Connect.t -> string
val get_max_vcpus :
[> `R ] Libvirt.Connect.t -> ?type_:string -> unit -> int
val list_domains : [> `R ] Libvirt.Connect.t -> int -> int array
val num_of_domains : [> `R ] Libvirt.Connect.t -> int
val get_capabilities : [> `R ] Libvirt.Connect.t -> Libvirt.xml
val num_of_defined_domains : [> `R ] Libvirt.Connect.t -> int
val list_defined_domains :
[> `R ] Libvirt.Connect.t -> int -> string array
val num_of_networks : [> `R ] Libvirt.Connect.t -> int
val list_networks : [> `R ] Libvirt.Connect.t -> int -> string array
val num_of_defined_networks : [> `R ] Libvirt.Connect.t -> int
val list_defined_networks :
[> `R ] Libvirt.Connect.t -> int -> string array
val num_of_pools : [> `R ] Libvirt.Connect.t -> int
val list_pools : [> `R ] Libvirt.Connect.t -> int -> string array
val num_of_defined_pools : [> `R ] Libvirt.Connect.t -> int
val list_defined_pools :
[> `R ] Libvirt.Connect.t -> int -> string array
val get_node_info :
[> `R ] Libvirt.Connect.t -> Libvirt.Connect.node_info
val node_get_free_memory : [> `R ] Libvirt.Connect.t -> int64
val node_get_cells_free_memory :
[> `R ] Libvirt.Connect.t -> int -> int -> int64 array
val maxcpus_of_node_info : Libvirt.Connect.node_info -> int
val cpumaplen : int -> int
val use_cpu : string -> int -> unit
val unuse_cpu : string -> int -> unit
val cpu_usable : string -> int -> int -> int -> bool
external const :
[> `R ] Libvirt.Connect.t -> Libvirt.ro Libvirt.Connect.t
= "%identity"
end
module Domain :
sig
type 'rw t
type state =
InfoNoState
| InfoRunning
| InfoBlocked
| InfoPaused
| InfoShutdown
| InfoShutoff
| InfoCrashed
type info = {
state : Libvirt.Domain.state;
max_mem : int64;
memory : int64;
nr_virt_cpu : int;
cpu_time : int64;
}
type vcpu_state = VcpuOffline | VcpuRunning | VcpuBlocked
type vcpu_info = {
number : int;
vcpu_state : Libvirt.Domain.vcpu_state;
vcpu_time : int64;
cpu : int;
}
type sched_param = string * Libvirt.Domain.sched_param_value
and sched_param_value =
SchedFieldInt32 of int32
| SchedFieldUInt32 of int32
| SchedFieldInt64 of int64
| SchedFieldUInt64 of int64
| SchedFieldFloat of float
| SchedFieldBool of bool
type typed_param = string * Libvirt.Domain.typed_param_value
and typed_param_value =
TypedFieldInt32 of int32
| TypedFieldUInt32 of int32
| TypedFieldInt64 of int64
| TypedFieldUInt64 of int64
| TypedFieldFloat of float
| TypedFieldBool of bool
| TypedFieldString of string
type migrate_flag = Live
type memory_flag = Virtual
type list_flag = ListActive | ListInactive | ListAll
type block_stats = {
rd_req : int64;
rd_bytes : int64;
wr_req : int64;
wr_bytes : int64;
errs : int64;
}
type interface_stats = {
rx_bytes : int64;
rx_packets : int64;
rx_errs : int64;
rx_drop : int64;
tx_bytes : int64;
tx_packets : int64;
tx_errs : int64;
tx_drop : int64;
}
val max_peek : [> `R ] Libvirt.Domain.t -> int
val create_linux :
[> `W ] Libvirt.Connect.t ->
Libvirt.xml -> Libvirt.rw Libvirt.Domain.t
val lookup_by_id : 'a Libvirt.Connect.t -> int -> 'a Libvirt.Domain.t
val lookup_by_uuid :
'a Libvirt.Connect.t -> Libvirt.uuid -> 'a Libvirt.Domain.t
val lookup_by_uuid_string :
'a Libvirt.Connect.t -> string -> 'a Libvirt.Domain.t
val lookup_by_name :
'a Libvirt.Connect.t -> string -> 'a Libvirt.Domain.t
val destroy : [> `W ] Libvirt.Domain.t -> unit
val free : [> `R ] Libvirt.Domain.t -> unit
val suspend : [> `W ] Libvirt.Domain.t -> unit
val resume : [> `W ] Libvirt.Domain.t -> unit
val save : [> `W ] Libvirt.Domain.t -> Libvirt.filename -> unit
val restore : [> `W ] Libvirt.Connect.t -> Libvirt.filename -> unit
val core_dump : [> `W ] Libvirt.Domain.t -> Libvirt.filename -> unit
val shutdown : [> `W ] Libvirt.Domain.t -> unit
val reboot : [> `W ] Libvirt.Domain.t -> unit
val get_name : [> `R ] Libvirt.Domain.t -> string
val get_uuid : [> `R ] Libvirt.Domain.t -> Libvirt.uuid
val get_uuid_string : [> `R ] Libvirt.Domain.t -> string
val get_id : [> `R ] Libvirt.Domain.t -> int
val get_os_type : [> `R ] Libvirt.Domain.t -> string
val get_max_memory : [> `R ] Libvirt.Domain.t -> int64
val set_max_memory : [> `W ] Libvirt.Domain.t -> int64 -> unit
val set_memory : [> `W ] Libvirt.Domain.t -> int64 -> unit
val get_info : [> `R ] Libvirt.Domain.t -> Libvirt.Domain.info
val get_xml_desc : [> `R ] Libvirt.Domain.t -> Libvirt.xml
val get_scheduler_type : [> `R ] Libvirt.Domain.t -> string * int
val get_scheduler_parameters :
[> `R ] Libvirt.Domain.t -> int -> Libvirt.Domain.sched_param array
val set_scheduler_parameters :
[> `W ] Libvirt.Domain.t -> Libvirt.Domain.sched_param array -> unit
val define_xml :
[> `W ] Libvirt.Connect.t ->
Libvirt.xml -> Libvirt.rw Libvirt.Domain.t
val undefine : [> `W ] Libvirt.Domain.t -> unit
val create : [> `W ] Libvirt.Domain.t -> unit
val get_autostart : [> `R ] Libvirt.Domain.t -> bool
val set_autostart : [> `W ] Libvirt.Domain.t -> bool -> unit
val set_vcpus : [> `W ] Libvirt.Domain.t -> int -> unit
val pin_vcpu : [> `W ] Libvirt.Domain.t -> int -> string -> unit
val get_vcpus :
[> `R ] Libvirt.Domain.t ->
int -> int -> int * Libvirt.Domain.vcpu_info array * string
val get_cpu_stats :
[> `R ] Libvirt.Domain.t ->
int -> Libvirt.Domain.typed_param list array
val get_max_vcpus : [> `R ] Libvirt.Domain.t -> int
val attach_device : [> `W ] Libvirt.Domain.t -> Libvirt.xml -> unit
val detach_device : [> `W ] Libvirt.Domain.t -> Libvirt.xml -> unit
val migrate :
[> `W ] Libvirt.Domain.t ->
[> `W ] Libvirt.Connect.t ->
Libvirt.Domain.migrate_flag list ->
?dname:string ->
?uri:string -> ?bandwidth:int -> unit -> Libvirt.rw Libvirt.Domain.t
val block_stats :
[> `R ] Libvirt.Domain.t -> string -> Libvirt.Domain.block_stats
val interface_stats :
[> `R ] Libvirt.Domain.t -> string -> Libvirt.Domain.interface_stats
val block_peek :
[> `W ] Libvirt.Domain.t ->
string -> int64 -> int -> string -> int -> unit
val memory_peek :
[> `W ] Libvirt.Domain.t ->
Libvirt.Domain.memory_flag list ->
int64 -> int -> string -> int -> unit
external const :
[> `R ] Libvirt.Domain.t -> Libvirt.ro Libvirt.Domain.t = "%identity"
val get_domains :
([> `R ] as 'a) Libvirt.Connect.t ->
Libvirt.Domain.list_flag list -> 'a Libvirt.Domain.t list
val get_domains_and_infos :
([> `R ] as 'a) Libvirt.Connect.t ->
Libvirt.Domain.list_flag list ->
('a Libvirt.Domain.t * Libvirt.Domain.info) list
end
module Network :
sig
type 'rw t
val lookup_by_name :
'a Libvirt.Connect.t -> string -> 'a Libvirt.Network.t
val lookup_by_uuid :
'a Libvirt.Connect.t -> Libvirt.uuid -> 'a Libvirt.Network.t
val lookup_by_uuid_string :
'a Libvirt.Connect.t -> string -> 'a Libvirt.Network.t
val create_xml :
[> `W ] Libvirt.Connect.t ->
Libvirt.xml -> Libvirt.rw Libvirt.Network.t
val define_xml :
[> `W ] Libvirt.Connect.t ->
Libvirt.xml -> Libvirt.rw Libvirt.Network.t
val undefine : [> `W ] Libvirt.Network.t -> unit
val create : [> `W ] Libvirt.Network.t -> unit
val destroy : [> `W ] Libvirt.Network.t -> unit
val free : [> `R ] Libvirt.Network.t -> unit
val get_name : [> `R ] Libvirt.Network.t -> string
val get_uuid : [> `R ] Libvirt.Network.t -> Libvirt.uuid
val get_uuid_string : [> `R ] Libvirt.Network.t -> string
val get_xml_desc : [> `R ] Libvirt.Network.t -> Libvirt.xml
val get_bridge_name : [> `R ] Libvirt.Network.t -> string
val get_autostart : [> `R ] Libvirt.Network.t -> bool
val set_autostart : [> `W ] Libvirt.Network.t -> bool -> unit
external const :
[> `R ] Libvirt.Network.t -> Libvirt.ro Libvirt.Network.t
= "%identity"
end
module Pool :
sig
type 'rw t
type pool_state = Inactive | Building | Running | Degraded
type pool_build_flags = New | Repair | Resize
type pool_delete_flags = Normal | Zeroed
type pool_info = {
state : Libvirt.Pool.pool_state;
capacity : int64;
allocation : int64;
available : int64;
}
val lookup_by_name :
'a Libvirt.Connect.t -> string -> 'a Libvirt.Pool.t
val lookup_by_uuid :
'a Libvirt.Connect.t -> Libvirt.uuid -> 'a Libvirt.Pool.t
val lookup_by_uuid_string :
'a Libvirt.Connect.t -> string -> 'a Libvirt.Pool.t
val create_xml :
[> `W ] Libvirt.Connect.t -> Libvirt.xml -> Libvirt.rw Libvirt.Pool.t
val define_xml :
[> `W ] Libvirt.Connect.t -> Libvirt.xml -> Libvirt.rw Libvirt.Pool.t
val build :
[> `W ] Libvirt.Pool.t -> Libvirt.Pool.pool_build_flags -> unit
val undefine : [> `W ] Libvirt.Pool.t -> unit
val create : [> `W ] Libvirt.Pool.t -> unit
val destroy : [> `W ] Libvirt.Pool.t -> unit
val delete : [> `W ] Libvirt.Pool.t -> unit
val free : [> `R ] Libvirt.Pool.t -> unit
val refresh : [ `R ] Libvirt.Pool.t -> unit
val get_name : [ `R ] Libvirt.Pool.t -> string
val get_uuid : [ `R ] Libvirt.Pool.t -> Libvirt.uuid
val get_uuid_string : [ `R ] Libvirt.Pool.t -> string
val get_info : [ `R ] Libvirt.Pool.t -> Libvirt.Pool.pool_info
val get_xml_desc : [ `R ] Libvirt.Pool.t -> Libvirt.xml
val get_autostart : [ `R ] Libvirt.Pool.t -> bool
val set_autostart : [ `W ] Libvirt.Pool.t -> bool -> unit
val num_of_volumes : [ `R ] Libvirt.Pool.t -> int
val list_volumes : [ `R ] Libvirt.Pool.t -> int -> string array
external const : [> `R ] Libvirt.Pool.t -> Libvirt.ro Libvirt.Pool.t
= "%identity"
end
module Volume :
sig
type 'rw t
type vol_type = File | Block
type vol_delete_flags = Normal | Zeroed
type vol_info = {
typ : Libvirt.Volume.vol_type;
capacity : int64;
allocation : int64;
}
val lookup_by_name : 'a Libvirt.Pool.t -> string -> 'a Libvirt.Volume.t
val lookup_by_key :
'a Libvirt.Connect.t -> string -> 'a Libvirt.Volume.t
val lookup_by_path :
'a Libvirt.Connect.t -> string -> 'a Libvirt.Volume.t
val pool_of_volume : 'a Libvirt.Volume.t -> 'a Libvirt.Pool.t
val get_name : [ `R ] Libvirt.Volume.t -> string
val get_key : [ `R ] Libvirt.Volume.t -> string
val get_path : [ `R ] Libvirt.Volume.t -> string
val get_info : [ `R ] Libvirt.Volume.t -> Libvirt.Volume.vol_info
val get_xml_desc : [ `R ] Libvirt.Volume.t -> Libvirt.xml
val create_xml : [ `W ] Libvirt.Pool.t -> Libvirt.xml -> unit
val delete : [ `W ] Libvirt.Volume.t -> unit
val free : [> `R ] Libvirt.Volume.t -> unit
external const :
[> `R ] Libvirt.Volume.t -> Libvirt.ro Libvirt.Volume.t = "%identity"
end
module Virterror :
sig
type code =
VIR_ERR_OK
| VIR_ERR_INTERNAL_ERROR
| VIR_ERR_NO_MEMORY
| VIR_ERR_NO_SUPPORT
| VIR_ERR_UNKNOWN_HOST
| VIR_ERR_NO_CONNECT
| VIR_ERR_INVALID_CONN
| VIR_ERR_INVALID_DOMAIN
| VIR_ERR_INVALID_ARG
| VIR_ERR_OPERATION_FAILED
| VIR_ERR_GET_FAILED
| VIR_ERR_POST_FAILED
| VIR_ERR_HTTP_ERROR
| VIR_ERR_SEXPR_SERIAL
| VIR_ERR_NO_XEN
| VIR_ERR_XEN_CALL
| VIR_ERR_OS_TYPE
| VIR_ERR_NO_KERNEL
| VIR_ERR_NO_ROOT
| VIR_ERR_NO_SOURCE
| VIR_ERR_NO_TARGET
| VIR_ERR_NO_NAME
| VIR_ERR_NO_OS
| VIR_ERR_NO_DEVICE
| VIR_ERR_NO_XENSTORE
| VIR_ERR_DRIVER_FULL
| VIR_ERR_CALL_FAILED
| VIR_ERR_XML_ERROR
| VIR_ERR_DOM_EXIST
| VIR_ERR_OPERATION_DENIED
| VIR_ERR_OPEN_FAILED
| VIR_ERR_READ_FAILED
| VIR_ERR_PARSE_FAILED
| VIR_ERR_CONF_SYNTAX
| VIR_ERR_WRITE_FAILED
| VIR_ERR_XML_DETAIL
| VIR_ERR_INVALID_NETWORK
| VIR_ERR_NETWORK_EXIST
| VIR_ERR_SYSTEM_ERROR
| VIR_ERR_RPC
| VIR_ERR_GNUTLS_ERROR
| VIR_WAR_NO_NETWORK
| VIR_ERR_NO_DOMAIN
| VIR_ERR_NO_NETWORK
| VIR_ERR_INVALID_MAC
| VIR_ERR_AUTH_FAILED
| VIR_ERR_INVALID_STORAGE_POOL
| VIR_ERR_INVALID_STORAGE_VOL
| VIR_WAR_NO_STORAGE
| VIR_ERR_NO_STORAGE_POOL
| VIR_ERR_NO_STORAGE_VOL
| VIR_ERR_UNKNOWN of int
val string_of_code : Libvirt.Virterror.code -> string
type domain =
VIR_FROM_NONE
| VIR_FROM_XEN
| VIR_FROM_XEND
| VIR_FROM_XENSTORE
| VIR_FROM_SEXPR
| VIR_FROM_XML
| VIR_FROM_DOM
| VIR_FROM_RPC
| VIR_FROM_PROXY
| VIR_FROM_CONF
| VIR_FROM_QEMU
| VIR_FROM_NET
| VIR_FROM_TEST
| VIR_FROM_REMOTE
| VIR_FROM_OPENVZ
| VIR_FROM_XENXM
| VIR_FROM_STATS_LINUX
| VIR_FROM_STORAGE
| VIR_FROM_UNKNOWN of int
val string_of_domain : Libvirt.Virterror.domain -> string
type level =
VIR_ERR_NONE
| VIR_ERR_WARNING
| VIR_ERR_ERROR
| VIR_ERR_UNKNOWN_LEVEL of int
val string_of_level : Libvirt.Virterror.level -> string
type t = {
code : Libvirt.Virterror.code;
domain : Libvirt.Virterror.domain;
message : string option;
level : Libvirt.Virterror.level;
str1 : string option;
str2 : string option;
str3 : string option;
int1 : int32;
int2 : int32;
}
val to_string : Libvirt.Virterror.t -> string
val get_last_error : unit -> Libvirt.Virterror.t option
val get_last_conn_error :
[> `R ] Libvirt.Connect.t -> Libvirt.Virterror.t option
val reset_last_error : unit -> unit
val reset_last_conn_error : [> `R ] Libvirt.Connect.t -> unit
val no_error : unit -> Libvirt.Virterror.t
end
exception Virterror of Libvirt.Virterror.t
exception Not_supported of string
val map_ignore_errors : ('a -> 'b) -> 'a list -> 'b list
end`