WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH] Supplemental packs: reflect homogeneity in package str

To: xen-api <xen-api@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-API] [PATCH] Supplemental packs: reflect homogeneity in package strings in Host.software_version
From: Rob Hoes <rob.hoes@xxxxxxxxxx>
Date: Fri, 6 Nov 2009 17:41:44 +0000
Delivery-date: Fri, 06 Nov 2009 09:41:48 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Rob Hoes <rob.hoes@xxxxxxxxxx>
Supplemental packs: reflect homogeneity in package strings in 
Host.software_version

If the XML file containing the description of a supplemental pack has the 
enforce-homogeneity attribute present and set to "true", append ", homogeneous" 
to the pack's string in Host.software_version.

Signed-off-by: Rob Hoes <rob.hoes@xxxxxxxxxx>

diff -r 212155f4ac57 ocaml/xapi/create_misc.ml
--- a/ocaml/xapi/create_misc.ml Thu Nov 05 11:40:52 2009 +0000
+++ b/ocaml/xapi/create_misc.ml Fri Nov 06 17:24:35 2009 +0000
@@ -308,8 +308,14 @@
   Printf.sprintf "%d.%d" Xapi_globs.version_major Xapi_globs.version_minor  
   
 (** Create assoc list of Supplemental-Pack information.
+ *  The package information is taking from the [XS-REPOSITORY] XML file in the 
package
+ *  directory.
+ *  The keys have the form "<originator>:<name>", the value is
+ *  "<description>, version <version>", appended by ", build <build>" if the 
<build>
+ *  number is present in the XML file, and appended by ", homogeneous" if the 
[enforce-homogeneity]
+ *  attribute is present and set to "true".
  *  For backwards compatibility, the old [package-linux] key is also added
- *  when the linux pack (now xs:linux) is present (alongside the new key).
+ *  when the linux pack (now [xs:linux]) is present (alongside the new key).
  *  The [package-linux] key is now deprecated and will be removed in the next 
version. *)
 let make_packs_info () =
        try
@@ -326,15 +332,22 @@
                                                if List.mem_assoc "build" attr 
then Some (List.assoc "build" attr)
                                                else None
                                        in
+                                       let homogeneous = 
+                                               if List.mem_assoc 
"enforce-homogeneity" attr &&
+                                                       (List.assoc 
"enforce-homogeneity" attr) = "true" then true
+                                               else false
+                                       in
                                        let description = match children with
                                                | Xml.Element(_, _, (Xml.PCData 
s) :: _) :: _ -> s
                                                | _ -> failwith "error with 
parsing pack data"
                                        in
                                        let param_name = originator ^ ":" ^ 
name in
                                        let value = description ^ ", version " 
^ version ^
-                                               match build with
+                                               (match build with
                                                | Some build -> ", build " ^ 
build
-                                               | None -> ""
+                                               | None -> "") ^
+                                               (if homogeneous then ", 
homogeneous"
+                                               else "")
                                        in
                                        let kv = [(param_name, value)] in
                                        if originator = "xs" && name = "linux" 
then

Attachment: packs-homogeneity
Description: Text document

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-API] [PATCH] Supplemental packs: reflect homogeneity in package strings in Host.software_version, Rob Hoes <=