Add a fs_dev field to filesystem
[virt-df.git] / lib / diskimage_utils.mli
index 91f43e0..bc67474 100644 (file)
@@ -26,27 +26,41 @@ class virtual device :
   object
     method virtual name : string
     method virtual size : int64
-    method close : unit -> unit
-    method virtual read : int64 -> int -> string
+    method read : int64 -> int -> string
     method read_bitstring : int64 -> int -> Bitmatch.bitstring
+    method virtual blocksize : int
+    method virtual mapblock : int64 -> (device * int64) list
   end
 
-class block_device : string ->
+class block_device : string -> int ->
   object
     method name : string
     method size : int64
+    method read : int64 -> int -> string
+    method read_bitstring : int64 -> int -> Bitmatch.bitstring
+    method blocksize : int
+    method mapblock : int64 -> (device * int64) list
     method close : unit -> unit
+  end
+
+class offset_device : string -> int64 -> int64 -> int -> device ->
+  object
+    method name : string
+    method size : int64
     method read : int64 -> int -> string
     method read_bitstring : int64 -> int -> Bitmatch.bitstring
+    method blocksize : int
+    method mapblock : int64 -> (device * int64) list
   end
 
-class offset_device : string -> int64 -> int64 -> device ->
+class blocksize_overlay : int -> device ->
   object
     method name : string
     method size : int64
-    method close : unit -> unit
     method read : int64 -> int -> string
     method read_bitstring : int64 -> int -> Bitmatch.bitstring
+    method blocksize : int
+    method mapblock : int64 -> (device * int64) list
   end
 
 val null_device : device
@@ -60,7 +74,7 @@ type machine = {
 
 and disk = {
   d_name : string;
-  d_dev : device;
+  d_dev : block_device;
   d_content : disk_content;
 }
 
@@ -72,7 +86,7 @@ and disk_content =
     ]
 
 and partitions = {
-  parts_name : string;
+  parts_plugin_id : parts_plugin_id;
   parts : partition list;
 }
 and partition = {
@@ -90,7 +104,8 @@ and partition_content =
     ]
 
 and filesystem = {
-  fs_name : string;
+  fs_dev : device;
+  fs_plugin_id : fs_plugin_id;
   fs_block_size : int64;
   fs_blocks_total : int64;
   fs_is_swap : bool;
@@ -111,11 +126,10 @@ and lv = {
   lv_dev : device;
 }
 
+and parts_plugin_id = string
+and fs_plugin_id = string
 and lvm_plugin_id = string
 
-val string_of_partition : partition -> string
-val string_of_filesystem : filesystem -> string
-
 (** {2 Internal functions used by the plug-ins} *)
 
 val canonical_uuid : string -> string