Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
+(* Don't use the functions and types in here directly. The safe ones
+ * are reexported through the Diskimage module, see diskimage.mli.
+ *)
+
(**/**)
val debug : bool ref
]
and partitions = {
- parts_plugin_id : parts_plugin_id;
+ parts_cb : partitioner_callbacks;
parts_dev : device;
parts : partition list;
}
]
and filesystem = {
- fs_plugin_id : fs_plugin_id;
+ fs_cb : filesystem_callbacks;
fs_dev : device;
fs_blocksize : Int63.t;
fs_blocks_total : Int63.t;
}
and pv = {
- lvm_plugin_id : lvm_plugin_id;
+ pv_cb : lvm_callbacks;
pv_dev : device;
pv_uuid : string;
}
lv_dev : device;
}
-and parts_plugin_id = string
-and fs_plugin_id = string
-and lvm_plugin_id = string
-
(** {2 Table of callbacks from each type of plug-in} *)
-type parts_cb = {
- parts_cb_probe : device -> partitions;
+and partitioner_probe = device -> partitions
+
+and partitioner_callbacks = {
+ parts_cb_name : string;
parts_cb_offset_is_free : partitions -> Int63.t -> bool;
}
-type fs_cb = {
- fs_cb_probe : device -> filesystem;
+and filesystem_probe = device -> filesystem
+
+and filesystem_callbacks = {
+ fs_cb_name : string;
+ fs_cb_printable_name : string;
fs_cb_offset_is_free : filesystem -> Int63.t -> bool;
}
-type lvm_cb = {
- lvm_cb_probe : lvm_plugin_id -> device -> pv;
- lvm_cb_list_lvs : device list -> lv list;
+and lvm_probe = device -> pv
+
+and lvm_callbacks = {
+ lvm_cb_name : string;
+ lvm_cb_list_lvs : pv list -> lv list;
lvm_cb_offset_is_free : pv -> Int63.t -> bool;
}
+val name_of_filesystem : filesystem -> string
+
+(** {3 Plug-in registration} *)
+
+val register_plugin :
+ ?partitioner:partitioner_probe ->
+ ?filesystem:filesystem_probe ->
+ ?lvm:lvm_probe ->
+ string -> unit
+
+(** {3 Plug-in-specific data management. *)
+
+
+
+
+
(** {2 Internal functions used by the plug-ins} *)
val canonical_uuid : string -> string
(** [range a b] returns the list of integers [a <= i < b].
If [a >= b] then the empty list is returned.
*)
+
+(** {2 Functions} *)
+
+val open_machine : string -> (string * string) list -> machine
+val close_machine : machine -> unit
+val scan_machine : machine -> machine
+
+type ownership
+
+val create_ownership : machine -> ownership
+
+type owner =
+ [ `Filesystem of filesystem
+ | `Partitions of partitions
+ | `PhysicalVolume of pv ]
+
+val get_owners_lookup : machine -> ownership -> block_device ->
+ (Int63.t -> (owner * Int63.t) list)
+val offset_is_free : (owner * Int63.t) list -> bool