# Module Libvirt.Pool

    module Pool: sig .. end

Module dealing with storage pools.

    type 'rw t

Storage pool handle.

    type pool_state =

`|` | `Inactive`
`|` | `Building`
`|` | `Running`
`|` | `Degraded`
`|` | `Inaccessible` | `(*` | State of the storage pool. | `*)`

    type pool_build_flags =

`|` | `New`
`|` | `Repair`
`|` | `Resize` | `(*` | Flags for creating a storage pool. | `*)`

    type pool_delete_flags =

`|` | `Normal`
`|` | `Zeroed` | `(*` | Flags for deleting a storage pool. | `*)`

    type pool_info = {

`` | `state : `pool_state`;` | `(*` | Pool state. | `*)`
`` | `capacity : `int64`;` | `(*` | Logical size in bytes. | `*)`
`` | `allocation : `int64`;` | `(*` | Currently allocated in bytes. | `*)`
`` | `available : `int64`;` | `(*` | Remaining free space bytes. | `*)`

}

    val lookup_by_name : 'a Libvirt.Connect.t -> string -> '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

Look up a storage pool by name, UUID or UUID string.

    val create_xml : [> `W ] Libvirt.Connect.t -> Libvirt.xml -> Libvirt.rw t

Create a storage pool.

    val define_xml : [> `W ] Libvirt.Connect.t -> Libvirt.xml -> Libvirt.rw t

Define but don't activate a storage pool.

    val build : [> `W ] t -> pool_build_flags -> unit

Build a storage pool.

    val undefine : [> `W ] t -> unit

Undefine configuration of a storage pool.

    val create : [> `W ] t -> unit

Start up a defined (inactive) storage pool.

    val destroy : [> `W ] t -> unit

Destroy a storage pool.

    val delete : [> `W ] t -> unit

Delete a storage pool.

    val free : [> `R ] t -> unit

Free a storage pool object in memory.

The storage pool object is automatically freed if it is garbage collected. This function just forces it to be freed right away.

    val refresh : [ `R ] t -> unit

Refresh the list of volumes in the storage pool.

    val get_name : [ `R ] t -> string

Name of the pool.

    val get_uuid : [ `R ] t -> Libvirt.uuid

Get the UUID (as a packed byte array).

    val get_uuid_string : [ `R ] t -> string

Get the UUID (as a printable string).

    val get_info : [ `R ] t -> pool_info

Get information about the pool.

    val get_xml_desc : [ `R ] t -> Libvirt.xml

Get the XML description.

    val get_autostart : [ `R ] t -> bool

Get the autostart flag for the storage pool.

    val set_autostart : [> `W ] t -> bool -> unit

Set the autostart flag for the storage pool.

    val num_of_volumes : [ `R ] t -> int

Returns the number of storage volumes within the storage pool.

    val list_volumes : [ `R ] t -> int -> string array

Return list of storage volumes.

    val const : [> `R ] t -> Libvirt.ro t

`const conn` turns a read/write storage pool into a read-only pool. Note that the opposite operation is impossible.