Restructure library plug-ins again.
[virt-df.git] / lib / diskimage_mbr.ml
index 009ef72..0de443b 100644 (file)
@@ -24,11 +24,11 @@ open Printf
 open Unix
 open ExtList
 
-open Diskimage_utils
+open Diskimage_impl
 
 open Int63.Operators
 
-let plugin_id = "mbr"
+let id = "mbr"
 
 let sector_size = ~^512
 
@@ -91,7 +91,7 @@ let rec probe dev =
       let extendeds = List.concat extendeds in
       primaries @ extendeds
 *)
-      { parts_plugin_id = plugin_id; parts_dev = dev; parts = primaries }
+      { parts_cb = callbacks; parts_dev = dev; parts = primaries }
 
   | { _ } ->
       raise Not_found                  (* not an MBR *)
@@ -188,9 +188,12 @@ and uint64_of_int32 u32 =
 (* XXX We don't currently keep enough data in the parts structure
  * to allow us to reconstruct missing partition table entries.
  *)
-let offset_is_free _ _ = false
+and offset_is_free _ _ = false
 
-let callbacks = {
-  parts_cb_probe = probe;
+and callbacks = {
+  parts_cb_name = id;
   parts_cb_offset_is_free = offset_is_free;
 }
+
+(* Register the plugin. *)
+let () = register_plugin ~partitioner:probe id