Use offset_device
[virt-top.git] / virt-df / virt_df.mli
index d40c934..f35e0db 100644 (file)
@@ -21,9 +21,6 @@
     used throughout the plug-ins and main code.
 *)
 
-val debug : bool
-(** If true, emit logs of debugging information to stderr. *)
-
 val ( +* ) : int32 -> int32 -> int32
 val ( -* ) : int32 -> int32 -> int32
 val ( ** ) : int32 -> int32 -> int32
@@ -34,6 +31,7 @@ val ( *^ ) : int64 -> int64 -> int64
 val ( /^ ) : int64 -> int64 -> int64
 (** int32 and int64 infix operators for convenience. *)
 
+val debug : bool ref                   (** If true, emit debug info to stderr*)
 val uri : string option ref            (** Hypervisor/libvirt URI. *)
 val inodes : bool ref                  (** Display inodes. *)
 val human : bool ref                   (** Display human-readable. *)
@@ -102,8 +100,7 @@ class virtual device :
      Note the very rare use of OOP in OCaml!
   *)
 
-class block_device :
-  string ->
+class block_device : string ->
   object
     method name : string
     method read : int64 -> int -> string
@@ -112,6 +109,23 @@ class block_device :
   end
     (** A concrete device which just direct-maps a file or /dev device. *)
 
+class offset_device : string -> int64 -> int64 -> device ->
+  object
+    method name : string
+    method read : int64 -> int -> string
+    method read_bitstring : int64 -> int -> string * int * int
+    method size : int64
+  end
+    (** A concrete device which maps a linear part of an underlying device.
+
+       [new offset_device name start size dev] creates a new
+       device which maps bytes from [start] to [start+size-1]
+       of the underlying device [dev] (ie. in this device they
+       appear as bytes [0] to [size-1]).
+
+       Useful for things like partitions.
+    *)
+
 val null_device : device
     (** The null device.  Any attempt to read generates an error. *)
 
@@ -119,7 +133,8 @@ type domain = {
   dom_name : string;                   (** Domain name. *)
   dom_id : int option;                 (** Domain ID (if running). *)
   dom_disks : disk list;               (** Domain disks. *)
-  dom_lv_filesystems : filesystem list;        (** Domain LV filesystems. *)
+  dom_lv_filesystems :
+    (lv * filesystem) list;            (** Domain LV filesystems. *)
 }
 and disk = {
   d_type : string option;              (** The <disk type=...> *)
@@ -179,6 +194,9 @@ val string_of_partition : partition -> string
 val string_of_filesystem : filesystem -> string
 (** Convert a partition or filesystem struct to a string (for debugging). *)
 
+val canonical_uuid : string -> string
+(** Convert a UUID which may contain '-' characters to canonical form. *)
+
 (** {2 Plug-in registration functions} *)
 
 val partition_type_register : string -> (device -> partitions) -> unit