Module Libvirt

module Libvirt: sig .. end
OCaml bindings for libvirt.

type uuid = string 
This is a "raw" UUID, ie. a packed string of bytes.
type xml = string 
Type of XML (an uninterpreted string of bytes). Use PXP, expat, xml-light, etc. if you want to do anything useful with the XML.
type filename = string 
A filename.
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
Length of packed UUIDs.
val uuid_string_length : int
Length of UUID strings.
type rw = [ `R | `W ] 
type ro = [ `R ] 
These phantom types are used to ensure the type-safety of read-only versus read-write connections.

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 dealing with connections.
module Domain: sig .. end
Module dealing with domains.
module Event: sig .. end
Module dealing with events generated by domain state changes.
module Network: sig .. end
Module dealing with networks.
module Pool: sig .. end
Module dealing with storage pools.
module Volume: sig .. end
Module dealing with storage volumes.
module Virterror: sig .. end
Module dealing with errors.
exception Virterror of Virterror.t
This exception can be raised by any library function that detects an error. To get a printable error message, call Libvirt.Virterror.to_string on the content of this exception.
exception Not_supported of string
Functions may raise 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.