Associate opaque plugin ID with each major structure.
[virt-df.git] / lib / diskimage_utils.ml
index 9290af3..a98e75e 100644 (file)
@@ -110,7 +110,7 @@ and disk_content =
 (* Partitions. *)
 
 and partitions = {
-  parts_name : string;                 (* Name of partitioning scheme. *)
+  parts_plugin_id : parts_plugin_id;   (* Partitioning scheme. *)
   parts : partition list               (* Partitions. *)
 }
 and partition = {
@@ -128,7 +128,7 @@ and partition_content =
 
 (* Filesystems (also swap devices). *)
 and filesystem = {
-  fs_name : string;                    (* Name of filesystem. *)
+  fs_plugin_id : fs_plugin_id;         (* Filesystem. *)
   fs_block_size : int64;               (* Block size (bytes). *)
   fs_blocks_total : int64;             (* Total blocks. *)
   fs_is_swap : bool;                   (* If swap, following not valid. *)
@@ -152,24 +152,10 @@ and lv = {
   lv_dev : device;                     (* Logical volume device. *)
 }
 
+and parts_plugin_id = string
+and fs_plugin_id = string
 and lvm_plugin_id = string
 
-(* Convert partition, filesystem types to printable strings for debugging. *)
-let string_of_partition
-    { part_status = status; part_type = typ; part_dev = dev } =
-  sprintf "%s: %s partition type %d"
-    dev#name
-    (match status with
-     | Bootable -> "bootable"
-     | Nonbootable -> "nonbootable"
-     | Malformed -> "malformed"
-     | NullEntry -> "empty")
-    typ
-
-let string_of_filesystem { fs_name = name; fs_is_swap = swap } =
-  if not swap then name
-  else name ^ " [swap]"
-
 (* Convert a UUID (containing '-' chars) to canonical form. *)
 let canonical_uuid uuid =
   let uuid' = String.make 32 ' ' in