module Domain:sig
..end
Domain.t
is the
domain object.type 'rw
t
ro Domain.t
and
read-write handles have type rw Domain.t
.type
state =
| |
InfoNoState |
| |
InfoRunning |
| |
InfoBlocked |
| |
InfoPaused |
| |
InfoShutdown |
| |
InfoShutoff |
| |
InfoCrashed |
type
info = {
|
state : |
(* |
running state
| *) |
|
max_mem : |
(* |
maximum memory in kilobytes
| *) |
|
memory : |
(* |
memory used in kilobytes
| *) |
|
nr_virt_cpu : |
(* |
number of virtual CPUs
| *) |
|
cpu_time : |
(* |
CPU time used in nanoseconds
| *) |
type
vcpu_state =
| |
VcpuOffline |
| |
VcpuRunning |
| |
VcpuBlocked |
type
vcpu_info = {
|
number : |
(* |
virtual CPU number
| *) |
|
vcpu_state : |
(* |
state
| *) |
|
vcpu_time : |
(* |
CPU time used in nanoseconds
| *) |
|
cpu : |
(* |
real CPU number, -1 if offline
| *) |
typesched_param =
string * sched_param_value
type
sched_param_value =
| |
SchedFieldInt32 of |
| |
SchedFieldUInt32 of |
| |
SchedFieldInt64 of |
| |
SchedFieldUInt64 of |
| |
SchedFieldFloat of |
| |
SchedFieldBool of |
typetyped_param =
string * typed_param_value
type
typed_param_value =
| |
TypedFieldInt32 of |
| |
TypedFieldUInt32 of |
| |
TypedFieldInt64 of |
| |
TypedFieldUInt64 of |
| |
TypedFieldFloat of |
| |
TypedFieldBool of |
| |
TypedFieldString of |
type
migrate_flag =
| |
Live |
type
memory_flag =
| |
Virtual |
type
list_flag =
| |
ListActive |
| |
ListInactive |
| |
ListAll |
type
block_stats = {
|
rd_req : |
|
rd_bytes : |
|
wr_req : |
|
wr_bytes : |
|
errs : |
type
interface_stats = {
|
rx_bytes : |
|
rx_packets : |
|
rx_errs : |
|
rx_drop : |
|
tx_bytes : |
|
tx_packets : |
|
tx_errs : |
|
tx_drop : |
val max_peek : [> `R ] t -> int
Libvirt.Domain.block_peek
and Libvirt.Domain.memory_peek
functions. If you want to peek more than this then you must
break your request into chunks.val create_linux : [> `W ] Libvirt.Connect.t -> Libvirt.xml -> Libvirt.rw t
val lookup_by_id : 'a Libvirt.Connect.t -> int -> 'a t
val lookup_by_uuid : 'a Libvirt.Connect.t -> Libvirt.uuid -> 'a t
val lookup_by_uuid_string : 'a Libvirt.Connect.t -> string -> 'a t
val lookup_by_name : 'a Libvirt.Connect.t -> string -> 'a t
val destroy : [> `W ] t -> unit
val free : [> `R ] t -> unit
free domain
frees the domain object in memory.
The domain object is automatically freed if it is garbage
collected. This function just forces it to be freed right
away.
val suspend : [> `W ] t -> unit
val resume : [> `W ] t -> unit
val save : [> `W ] t -> Libvirt.filename -> unit
val restore : [> `W ] Libvirt.Connect.t -> Libvirt.filename -> unit
val core_dump : [> `W ] t -> Libvirt.filename -> unit
val shutdown : [> `W ] t -> unit
val reboot : [> `W ] t -> unit
val get_name : [> `R ] t -> string
val get_uuid : [> `R ] t -> Libvirt.uuid
val get_uuid_string : [> `R ] t -> string
val get_id : [> `R ] t -> int
get_id dom
returns the ID of the domain. In most cases
this returns -1
if the domain is not running.val get_os_type : [> `R ] t -> string
val get_max_memory : [> `R ] t -> int64
val set_max_memory : [> `W ] t -> int64 -> unit
val set_memory : [> `W ] t -> int64 -> unit
val get_info : [> `R ] t -> info
val get_xml_desc : [> `R ] t -> Libvirt.xml
val get_scheduler_type : [> `R ] t -> string * int
val get_scheduler_parameters : [> `R ] t -> int -> sched_param array
val set_scheduler_parameters : [> `W ] t -> sched_param array -> unit
val define_xml : [> `W ] Libvirt.Connect.t -> Libvirt.xml -> Libvirt.rw t
val undefine : [> `W ] t -> unit
val create : [> `W ] t -> unit
val get_autostart : [> `R ] t -> bool
val set_autostart : [> `W ] t -> bool -> unit
val set_vcpus : [> `W ] t -> int -> unit
val pin_vcpu : [> `W ] t -> int -> string -> unit
pin_vcpu dom vcpu bitmap
pins a domain vCPU to a bitmap of physical
CPUs. See the libvirt documentation for details of the
layout of the bitmap.val get_vcpus : [> `R ] t ->
int -> int -> int * vcpu_info array * string
get_vcpus dom maxinfo maplen
returns the pinning information
for a domain. See the libvirt documentation for details
of the array and bitmap returned from this function.val get_cpu_stats : [> `R ] t -> typed_param list array
get_pcpu_stats dom
returns the physical CPU stats
for a domain. See the libvirt documentation for details.val get_max_vcpus : [> `R ] t -> int
val attach_device : [> `W ] t -> Libvirt.xml -> unit
val detach_device : [> `W ] t -> Libvirt.xml -> unit
val migrate : [> `W ] t ->
[> `W ] Libvirt.Connect.t ->
migrate_flag list ->
?dname:string ->
?uri:string -> ?bandwidth:int -> unit -> Libvirt.rw t
migrate dom dconn flags ()
migrates a domain to a
destination host described by dconn
.
The optional flag ?dname
is used to rename the domain.
The optional flag ?uri
is used to route the migration.
The optional flag ?bandwidth
is used to limit the bandwidth
used for migration (in Mbps).
val block_stats : [> `R ] t -> string -> block_stats
val interface_stats : [> `R ] t -> string -> interface_stats
val block_peek : [> `W ] t -> string -> int64 -> int -> string -> int -> unit
block_peek dom path offset size buf boff
reads size
bytes at
offset
in the domain's path
block device.
If successful then the data is written into buf
starting
at offset boff
, for size
bytes.
See also Libvirt.Domain.max_peek
.
val memory_peek : [> `W ] t ->
memory_flag list -> int64 -> int -> string -> int -> unit
memory_peek dom Virtual offset size
reads size
bytes
at offset
in the domain's virtual memory.
If successful then the data is written into buf
starting
at offset boff
, for size
bytes.
See also Libvirt.Domain.max_peek
.
val const : [> `R ] t -> Libvirt.ro t
const dom
turns a read/write domain handle into a read-only
domain handle. Note that the opposite operation is impossible.val get_domains : ([> `R ] as 'a) Libvirt.Connect.t ->
list_flag list -> 'a t list
See also:
Libvirt.Domain.get_domains_and_infos
,
Libvirt.Connect.list_domains
,
Libvirt.Connect.list_defined_domains
.
val get_domains_and_infos : ([> `R ] as 'a) Libvirt.Connect.t ->
list_flag list ->
('a t * info) list
See also:
Libvirt.Domain.get_domains
,
Libvirt.Connect.list_domains
,
Libvirt.Connect.list_defined_domains
,
Libvirt.Domain.get_info
.