type 'rw t
(** Storage pool handle. *)
- type pool_state = Inactive | Active
+ type pool_state = Inactive | Building | Running | Degraded
(** 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 Connect.t -> string -> 'a t
(** Create a storage pool. *)
val define_xml : [>`W] Connect.t -> xml -> 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 shutdown : [>`W] t -> unit
- (** Shutdown a storage pool. *)
+ val delete : [>`W] t -> unit
+ (** Delete a storage pool. *)
val free : [>`R] t -> unit
(** Free a storage pool object in memory.
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. *)
+
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.
type 'rw t
(** Storage volume handle. *)
- type vol_type = File | Block | Virtual
+ type vol_type = File | Block
(** Type of a storage volume. *)
+ type vol_delete_flags = Normal | Zeroed
+ (** Flags for deleting a storage volume. *)
+
type vol_info = {
typ : vol_type; (** Type of storage volume. *)
capacity : int64; (** Logical size 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
+ val lookup_by_key : 'a Connect.t -> string -> 'a t
+ val lookup_by_path : 'a Connect.t -> string -> 'a t
(** Look up a storage volume by name, key or path volume. *)
val pool_of_volume : 'a t -> 'a Pool.t
val create_xml : [`W] Pool.t -> xml -> unit
(** Create a storage volume. *)
- val destroy : [`W] t -> unit
- (** Destroy a storage volume. *)
+ val delete : [`W] t -> unit
+ (** Delete a storage volume. *)
val free : [>`R] t -> unit
(** Free a storage volume object in memory.
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.