module Connect:Module dealing with connections.sig
..end
Connect.t
is the
connection object.type 'a
t
ro Connect.t
and
read-write connections have type rw Connect.t
.type
node_info = {
|
model : |
(* | CPU model | *) |
|
memory : |
(* | memory size in kilobytes | *) |
|
cpus : |
(* | number of active CPUs | *) |
|
mhz : |
(* | expected CPU frequency | *) |
|
nodes : |
(* | number of NUMA nodes (1 = UMA) | *) |
|
sockets : |
(* | number of CPU sockets per node | *) |
|
cores : |
(* | number of cores per socket | *) |
|
threads : |
(* | number of threads per core | *) |
val connect : ?name:string -> unit -> Libvirt.rw t
val connect_readonly : ?name:string -> unit -> Libvirt.ro t
connect ~name ()
connects to the hypervisor with URI name
.
connect ()
connects to the default hypervisor.
connect_readonly
is the same but connects in read-only mode.
val close : [> `R ] t -> unit
close conn
closes and frees the connection object in memory.
The connection is automatically closed if it is garbage
collected. This function just forces it to be closed
and freed right away.
val get_type : [> `R ] t -> string
val get_version : [> `R ] t -> int
val get_hostname : [> `R ] t -> string
val get_uri : [> `R ] t -> string
val get_max_vcpus : [> `R ] t -> ?type_:string -> unit -> int
val list_domains : [> `R ] t -> int -> int array
val num_of_domains : [> `R ] t -> int
val get_capabilities : [> `R ] t -> string
val num_of_defined_domains : [> `R ] t -> int
val list_defined_domains : [> `R ] t -> int -> string array
val num_of_networks : [> `R ] t -> int
val list_networks : [> `R ] t -> int -> string array
val num_of_defined_networks : [> `R ] t -> int
val list_defined_networks : [> `R ] t -> int -> string array
val get_node_info : [> `R ] t -> node_info
val maxcpus_of_node_info : node_info -> int
val cpumaplen : int -> int
val use_cpu : string -> int -> unit
use_cpu cpumap cpu
marks cpu
as usable in cpumap
.val unuse_cpu : string -> int -> unit
unuse_cpu cpumap cpu
marks cpu
as not usable in cpumap
.val cpu_usable : string -> int -> int -> int -> bool
cpu_usable cpumaps maplen vcpu cpu
checks returns true iff the
cpu
is usable by vcpu
.val const : [> `R ] t -> Libvirt.ro t
const conn
turns a read/write connection into a read-only
connection. Note that the opposite operation is impossible.