signed-off-by: Rok Strnisa <[email protected]>

 mlvm/lv.ml |  35 ++++++++++++++++++-----------------
 1 files changed, 18 insertions(+), 17 deletions(-)


# HG changeset patch
# User Rok Strnisa <[email protected]>
# Date 1276260248 -3600
# Node ID aeba63846ef847beead153777e0ccd6c3fd6fc6a
# Parent  a885e486b46a6cd55257bfa00887f38f88f092db
Fixed typo: tag -> tags. Improved indentation. Added documentation.

signed-off-by: Rok Strnisa <[email protected]>

diff --git a/mlvm/lv.ml b/mlvm/lv.ml
--- a/mlvm/lv.ml
+++ b/mlvm/lv.ml
@@ -102,24 +102,25 @@ let segment_of_metadata name config =
 		 st_stripes=stripes}
   }
 
+(** Builds a logical_volume structure out of a name and metadata. *)
 let of_metadata name config =
-  let id = expect_mapped_string "id" config in
-  let status = map_expected_mapped_array "status" 
-    (fun a -> status_of_string (expect_string "status" a)) config in
-  let segments = filter_structs config in
-  let segments = List.map 
-    (fun (a,_) -> 
-      segment_of_metadata a (expect_mapped_struct a segments)) segments in
-  let tags = 
-    if List.mem_assoc "tags" config 
-    then map_expected_mapped_array "tags" (expect_string "tag") config 
-    else [] 
-  in
-  { name=name;
-    id=id;
-    status=status;
-    tags=tags;
-    segments=sort_segments segments }
+	let id = expect_mapped_string "id" config in
+	let status = map_expected_mapped_array "status"
+		(fun a -> status_of_string (expect_string "status" a)) config in
+	let tags =
+		List.map Tag.of_string
+			(if List.mem_assoc "tags" config
+			 then map_expected_mapped_array "tags" (expect_string "tags") config
+			 else []) in
+	let segments = filter_structs config in
+	let segments = List.map
+		(fun (a,_) ->
+			 segment_of_metadata a (expect_mapped_struct a segments)) segments in
+	{ name = name;
+	  id = id;
+	  status = status;
+	  tags = tags;
+	  segments = sort_segments segments }
 
 let allocation_of_segment s =
   match s.s_cls with
_______________________________________________
xen-api mailing list
[email protected]
http://lists.xensource.com/mailman/listinfo/xen-api

Reply via email to