X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=lib%2Fdiskimage_utils.mli;h=07179d8a2a7ac0bfcb13922e569882c5115e45e8;hb=8ecbebaf01f96a781ded3e24235697c62bc515b4;hp=641483d89e6eed074d1427c774232712d5f36519;hpb=e1e5cfb926e886b8fc3126429d045b8ba305fe50;p=virt-df.git diff --git a/lib/diskimage_utils.mli b/lib/diskimage_utils.mli index 641483d..07179d8 100644 --- a/lib/diskimage_utils.mli +++ b/lib/diskimage_utils.mli @@ -91,6 +91,7 @@ and disk_content = and partitions = { parts_plugin_id : parts_plugin_id; + parts_dev : device; parts : partition list; } and partition = { @@ -124,6 +125,7 @@ and filesystem = { and pv = { lvm_plugin_id : lvm_plugin_id; + pv_dev : device; pv_uuid : string; } and lv = { @@ -134,6 +136,24 @@ 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; + 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; +} + (** {2 Internal functions used by the plug-ins} *) val canonical_uuid : string -> string @@ -142,6 +162,14 @@ val canonical_uuid : string -> string val group_by : ?cmp:('a -> 'a -> int) -> ('a * 'b) list -> ('a * 'b list) list (** Group a sorted list of pairs by the first element of the pair. *) +val sort_uniq : ?cmp:('a -> 'a -> int) -> 'a list -> 'a list +(** [sort_uniq xs] returns the list [xs], sorted and with all duplicate + elements removed. *) + +val uniq : ?cmp:('a -> 'a -> int) -> 'a list -> 'a list +(** [uniq xs] removes adjacent duplicate elements from a list, like + the Unix uniq(1) command. *) + val range : int -> int -> int list (** [range a b] returns the list of integers [a <= i < b]. If [a >= b] then the empty list is returned.