Internationalize virt-df program.
[virt-top.git] / libvirt / libvirt.mli
index 61beee5..af372af 100644 (file)
@@ -385,8 +385,7 @@ sig
       *)
 end
   (** Module dealing with connections.  [Connect.t] is the
-      connection object.
-  *)
+      connection object. *)
 
 (** {3 Domains} *)
 
@@ -573,8 +572,7 @@ sig
       *)
 end
   (** Module dealing with domains.  [Domain.t] is the
-      domain object.
-  *)
+      domain object. *)
 
 (** {3 Networks} *)
 
@@ -634,8 +632,7 @@ sig
       *)
 end
   (** Module dealing with networks.  [Network.t] is the
-      network object.
-  *)
+      network object. *)
 
 (** {3 Storage pools} *)
 
@@ -644,12 +641,20 @@ sig
   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
@@ -661,14 +666,16 @@ sig
     (** 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.
 
@@ -694,6 +701,11 @@ sig
   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.
@@ -708,9 +720,12 @@ sig
   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. *)
@@ -718,8 +733,8 @@ sig
   }
 
   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
@@ -738,8 +753,8 @@ sig
 
   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.
 
@@ -766,9 +781,9 @@ sig
        The possible types for a job are:
 
 {v
-(`Domain, `W) Job.t            Job creating a r/w domain
+(`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 r/w network
+(`Network, `W) Job.t           Job creating a new network
 (`Network_nocreate, `W) Job.t  Job acting on an existing network
 v}
       *)
@@ -780,8 +795,8 @@ v}
     (** State of the job. *)
 
   type job_info = {
-    typ : job_type;                    (** Job type *)
-    state : job_state;                 (** Job state *)
+    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) *)
@@ -804,11 +819,20 @@ v}
   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} *)
 
@@ -860,7 +884,14 @@ sig
     | VIR_ERR_NO_DOMAIN
     | VIR_ERR_NO_NETWORK
     | VIR_ERR_INVALID_MAC
-       (* ^^ NB: If you add a variant you MUST edit libvirt_c.c:MAX_VIR_* *)
+    | VIR_ERR_AUTH_FAILED
+    | VIR_ERR_INVALID_STORAGE_POOL
+    | VIR_ERR_INVALID_STORAGE_VOL
+    | VIR_WAR_NO_STORAGE
+    | VIR_ERR_NO_STORAGE_POOL
+    | VIR_ERR_NO_STORAGE_VOL
+       (* ^^ NB: If you add a variant you MUST edit
+          libvirt_c_epilogue.c:MAX_VIR_* *)
     | VIR_ERR_UNKNOWN of int
        (** See [<libvirt/virterror.h>] for meaning of these codes. *)
 
@@ -884,7 +915,9 @@ sig
     | VIR_FROM_OPENVZ
     | VIR_FROM_XENXM
     | VIR_FROM_STATS_LINUX
-       (* ^^ NB: If you add a variant you MUST edit libvirt_c.c: MAX_VIR_* *)
+    | VIR_FROM_STORAGE
+       (* ^^ NB: If you add a variant you MUST edit
+          libvirt_c_epilogue.c: MAX_VIR_* *)
     | VIR_FROM_UNKNOWN of int
        (** Subsystem / driver which produced the error. *)