module Domain:Module dealing with domains.sig..end
Domain.t is the
domain object.type 'a 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 |
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 -> intLibvirt.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 list_all_domains : 'a Libvirt.Connect.t ->
?want_info:bool ->
list_flag list ->
'a t array * info arraylist_all_domains conn flags returns all domains which
match flags.
This can return both active and inactive domains. The
list of flags controls what domains are returned. See
Libvirt.Domain.list_flag.
The two arrays returned will have the same length, unless
~want_info is false in which case the info array
will be zero-length. The default for ~want_info is true.
In most cases there is no extra penalty for getting the
info fields, or the penalty is insignificant.
This call was introduced in libvirt 0.4.5. Because you
might dynamically link to an older version of libvirt which
doesn't have this call, you should use Libvirt.Domain.get_domains
or Libvirt.Domain.get_domains_and_infos which use the most efficient
way to get domains for the available version of libvirt.
val create_linux : [> `W ] Libvirt.Connect.t -> Libvirt.xml -> Libvirt.rw tval create_linux_job : [> `W ] Libvirt.Connect.t ->
Libvirt.xml -> ([ `Domain ], Libvirt.rw) Libvirt.job_tval lookup_by_id : 'a Libvirt.Connect.t -> int -> 'a tval lookup_by_uuid : 'a Libvirt.Connect.t -> Libvirt.uuid -> 'a tval lookup_by_uuid_string : 'a Libvirt.Connect.t -> string -> 'a tval lookup_by_name : 'a Libvirt.Connect.t -> string -> 'a tval destroy : [> `W ] t -> unitval free : [> `R ] t -> unitfree 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 -> unitval resume : [> `W ] t -> unitval save : [> `W ] t -> Libvirt.filename -> unitval save_job : [> `W ] t ->
Libvirt.filename -> ([ `Domain_nocreate ], Libvirt.rw) Libvirt.job_tval restore : [> `W ] Libvirt.Connect.t -> Libvirt.filename -> unitval restore_job : [> `W ] Libvirt.Connect.t ->
Libvirt.filename -> ([ `Domain_nocreate ], Libvirt.rw) Libvirt.job_tval core_dump : [> `W ] t -> Libvirt.filename -> unitval core_dump_job : [> `W ] t ->
Libvirt.filename -> ([ `Domain_nocreate ], Libvirt.rw) Libvirt.job_tval shutdown : [> `W ] t -> unitval reboot : [> `W ] t -> unitval get_name : [> `R ] t -> stringval get_uuid : [> `R ] t -> Libvirt.uuidval get_uuid_string : [> `R ] t -> stringval get_id : [> `R ] t -> intget_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 -> stringval get_max_memory : [> `R ] t -> int64val set_max_memory : [> `W ] t -> int64 -> unitval set_memory : [> `W ] t -> int64 -> unitval get_info : [> `R ] t -> infoval get_xml_desc : [> `R ] t -> Libvirt.xmlval get_scheduler_type : [> `R ] t -> string * intval get_scheduler_parameters : [> `R ] t -> int -> sched_param arrayval set_scheduler_parameters : [> `W ] t -> sched_param array -> unitval define_xml : [> `W ] Libvirt.Connect.t -> Libvirt.xml -> Libvirt.rw tval undefine : [> `W ] t -> unitval create : [> `W ] t -> unitval create_job : [> `W ] t -> ([ `Domain_nocreate ], Libvirt.rw) Libvirt.job_tval get_autostart : [> `R ] t -> boolval set_autostart : [> `W ] t -> bool -> unitval set_vcpus : [> `W ] t -> int -> unitval pin_vcpu : [> `W ] t -> int -> string -> unitpin_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 * stringget_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_max_vcpus : [> `R ] t -> intval attach_device : [> `W ] t -> Libvirt.xml -> unitval detach_device : [> `W ] t -> Libvirt.xml -> unitval migrate : [> `W ] t ->
[> `W ] Libvirt.Connect.t ->
migrate_flag list ->
?dname:string ->
?uri:string -> ?bandwidth:int -> unit -> Libvirt.rw tmigrate 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_statsval interface_stats : [> `R ] t -> string -> interface_statsval block_peek : [> `W ] t -> string -> int64 -> int -> string -> int -> unitblock_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 -> unitmemory_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 tconst 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.Domain.list_all_domains,
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.Domain.list_all_domains,
Libvirt.Connect.list_domains,
Libvirt.Connect.list_defined_domains,
Libvirt.Domain.get_info.