Use tables of callbacks for the functions.
[virt-df.git] / lib / diskimage_utils.ml
index 1a85f52..dc67e36 100644 (file)
@@ -234,6 +234,22 @@ and parts_plugin_id = string
 and fs_plugin_id = string
 and lvm_plugin_id = string
 
+type parts_cb = {
+  parts_cb_probe : device -> partitions;
+  parts_cb_offset_is_free : partitions -> Int63.t -> bool;
+}
+
+type fs_cb = {
+  fs_cb_probe : device -> filesystem;
+  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;
+  lvm_cb_offset_is_free : pv -> Int63.t -> bool;
+}
+
 (* Convert a UUID (containing '-' chars) to canonical form. *)
 let canonical_uuid uuid =
   let uuid' = String.make 32 ' ' in