module Libvirt:sig
..end
typeuuid =
string
typexml =
string
typefilename =
string
val get_version : ?driver:string -> unit -> int * int
get_version ()
returns the library version in the first part
of the tuple, and 0
in the second part.
get_version ~driver ()
returns the library version in the first
part of the tuple, and the version of the driver called driver
in the second part.
The version numbers are encoded as
1,000,000 * major + 1,000 * minor + release.
val uuid_length : int
val uuid_string_length : int
typerw =
[ `R | `W ]
typero =
[ `R ]
All connection/domain/etc. objects are marked with a phantom read-write or read-only type, and trying to pass a read-only object into a function which could mutate the object will cause a compile time error.
Each module provides a function like Libvirt.Connect.const
to demote a read-write object into a read-only object. The
opposite operation is, of course, not allowed.
If you want to handle both read-write and read-only connections at runtime, use a variant similar to this:
type conn_t =
| No_connection
| Read_only of Libvirt.ro Libvirt.Connect.t
| Read_write of Libvirt.rw Libvirt.Connect.t
module Connect:sig
..end
module Domain:sig
..end
module Event:sig
..end
module Network:sig
..end
module Pool:sig
..end
module Volume:sig
..end
module Virterror:sig
..end
exception Virterror of Virterror.t
Libvirt.Virterror.to_string
on the content of this exception.exception Not_supported of string
Not_supported "virFoo"
(where virFoo
is the libvirt function name) if a function is
not supported at either compile or run time. This applies to
any libvirt function added after version 0.2.1.
See also http://libvirt.org/hvsupport.html
val map_ignore_errors : ('a -> 'b) -> 'a list -> 'b list
map_ignore_errors f xs
calls function f
for each element of xs
.
This is just like List.map
except that if f x
throws a
Libvirt.Virterror.t
exception, the error is ignored and f x
is not returned in the final list.
This function is primarily useful when dealing with domains which
might 'disappear' asynchronously from the currently running
program.