+ network object. *)
+
+(** {3 Storage pools} *)
+
+module Pool :
+sig
+ type 'rw t
+ (** Storage pool handle. *)
+
+ type pool_state = Inactive | Active
+ (** State of the storage pool. *)
+
+ type pool_info = {
+ state : pool_state; (** Inactive | Active *)
+ capacity : int64; (** Logical size in bytes. *)
+ allocation : int64; (** Currently allocated in bytes. *)
+ }
+
+ val lookup_by_name : 'a Connect.t -> string -> 'a t
+ val lookup_by_uuid : 'a Connect.t -> uuid -> 'a t
+ val lookup_by_uuid_string : 'a Connect.t -> string -> 'a t
+ (** Look up a storage pool by name, UUID or UUID string. *)
+
+ val create_xml : [>`W] Connect.t -> xml -> rw t
+ (** Create a storage pool. *)
+ val define_xml : [>`W] Connect.t -> xml -> rw t
+ (** Define but don't activate 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 shutdown : [>`W] t -> unit
+ (** Shutdown 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 -> 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 -> 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. *)
+
+ external const : [>`R] t -> ro t = "%identity"
+ (** [const conn] turns a read/write storage pool into a read-only
+ pool. Note that the opposite operation is impossible.
+ *)
+end
+ (** Module dealing with storage pools. *)
+
+(** {3 Storage volumes} *)
+
+module Volume :
+sig
+ type 'rw t
+ (** Storage volume handle. *)
+
+ type vol_type = File | Block | Virtual
+ (** Type of a storage volume. *)
+
+ type vol_info = {
+ typ : vol_type; (** Type of storage volume. *)
+ capacity : int64; (** Logical size in bytes. *)
+ allocation : int64; (** Currently allocated in bytes. *)
+ }
+
+ val lookup_by_name : 'a Pool.t -> string -> 'a t
+ val lookup_by_key : 'a Pool.t -> string -> 'a t
+ val lookup_by_path : 'a Pool.t -> string -> 'a t
+ (** Look up a storage volume by name, key or path volume. *)
+
+ val pool_of_volume : 'a t -> 'a Pool.t
+ (** Get the storage pool containing this volume. *)
+
+ val get_name : [`R] t -> string
+ (** Name of the volume. *)
+ val get_key : [`R] t -> string
+ (** Key of the volume. *)
+ val get_path : [`R] t -> string
+ (** Path of the volume. *)
+ val get_info : [`R] t -> vol_info
+ (** Get information about the storage volume. *)
+ val get_xml_desc : [`R] t -> xml
+ (** Get the XML description. *)
+
+ val create_xml : [`W] Pool.t -> xml -> unit
+ (** Create a storage volume. *)
+ val destroy : [`W] t -> unit
+ (** Destroy a storage volume. *)
+ val free : [>`R] t -> unit
+ (** Free a storage volume object in memory.
+
+ The storage volume object is automatically freed if it is garbage
+ collected. This function just forces it to be freed right
+ away.
+ *)
+
+ external const : [>`R] t -> ro t = "%identity"
+ (** [const conn] turns a read/write storage volume into a read-only
+ volume. Note that the opposite operation is impossible.
+ *)
+end
+ (** Module dealing with storage volumes. *)
+
+(** {3 Jobs and asynchronous processing} *)
+
+module Job :
+sig
+ type ('jobclass, 'rw) t = ('jobclass, 'rw) job_t
+ (** A background asynchronous job.
+
+ Jobs represent a pending operation such as domain creation.
+ The possible types for a job are:
+
+{v
+(`Domain, `W) Job.t Job creating a new domain
+(`Domain_nocreate, `W) Job.t Job acting on an existing domain
+(`Network, `W) Job.t Job creating a new network
+(`Network_nocreate, `W) Job.t Job acting on an existing network
+v}
+ *)
+
+ type job_type = Bounded | Unbounded
+ (** A Bounded job is one where we can estimate time to completion. *)
+
+ type job_state = Running | Complete | Failed | Cancelled
+ (** State of the job. *)
+
+ type job_info = {
+ typ : job_type; (** Job type (Bounded, Unbounded) *)
+ state : job_state; (** Job state (Running, etc.) *)
+ running_time : int; (** Actual running time (seconds) *)
+ (** The following fields are only available in Bounded jobs: *)
+ remaining_time : int; (** Estimated time left (seconds) *)
+ percent_complete : int (** Estimated percent complete *)
+ }
+
+ val get_info : ('a,'b) t -> job_info
+ (** Get information and status about the job. *)
+
+ val get_domain : ([`Domain], 'a) t -> 'a Domain.t
+ (** Get the completed domain from a job.
+
+ You should only call it on a job in state Complete. *)
+
+ val get_network : ([`Network], 'a) t -> 'a Network.t
+ (** Get the completed network from a job.
+
+ You should only call it on a job in state Complete. *)
+
+ val cancel : ('a,'b) t -> unit
+ (** Cancel a job. *)
+
+ val free : ('a, [>`R]) t -> unit
+ (** Free a job object in memory.
+
+ The job object is automatically freed if it is garbage
+ collected. This function just forces it to be freed right
+ away.
+ *)
+
+ external const : ('a, [>`R]) t -> ('a, ro) t = "%identity"
+ (** [const conn] turns a read/write job into a read-only
+ job. Note that the opposite operation is impossible.
+ *)
+end
+ (** Module dealing with asynchronous jobs. *)
+
+(** {3 Error handling and exceptions} *)