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 10 of 12] [PCR0047] Adding appropriate boilerplate code

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH 10 of 12] [PCR0047] Adding appropriate boilerplate code for Dynamic Memory Control ("dmc") to the restrictions module
From: Jonathan Knowles <jonathan.knowles@xxxxxxxxxxxxx>
Date: Mon, 1 Feb 2010 16:32:12 +0000
Delivery-date: Mon, 01 Feb 2010 09:05:11 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1265041922@radon>
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 Jonathan Knowles <jonathan.knowles@xxxxxxxxxxxxx>
# Date 1265041876 0
# Node ID 9322132154fe8d245d0477e7d45419ec3d6e8d41
# Parent  e61b811f0c2c0867257b8053649a4343b4bd5ea0
[PCR0047] Adding appropriate boilerplate code for Dynamic Memory Control 
("dmc") to the restrictions module.

Signed-off-by: Jonathan Knowles <jonathan.knowles@xxxxxxxxxxxxx>

diff -r e61b811f0c2c -r 9322132154fe ocaml/license/restrictions.ml
--- a/ocaml/license/restrictions.ml     Mon Feb 01 15:59:05 2010 +0000
+++ b/ocaml/license/restrictions.ml     Mon Feb 01 16:31:16 2010 +0000
@@ -52,6 +52,7 @@
        enable_performance : bool;
        enable_wlb : bool;
        enable_rbac : bool;
+       enable_dmc : bool;
        restrict_connection : bool;
        platform_filter : bool;
        regular_nag_dialog : bool;
@@ -71,6 +72,7 @@
        (if x.enable_performance    then "perf "     else "     "    ) ^
        (if x.enable_wlb            then "WLB  "     else "     "    ) ^
        (if x.enable_rbac           then "RBAC "     else "     "    ) ^
+       (if x.enable_dmc            then "DMC "      else "    "     ) ^
        (if x.restrict_connection   then "     "     else "Cnx  "    ) ^
        (if x.platform_filter       then "     "     else "Plat "    ) ^
        (if x.regular_nag_dialog    then " nag "     else "     "    )
@@ -89,6 +91,7 @@
        enable_performance    = true;
        enable_wlb            = true;
        enable_rbac           = true;
+       enable_dmc            = true;
        restrict_connection   = false;
        platform_filter       = false;
        regular_nag_dialog    = false;
@@ -109,6 +112,7 @@
        enable_performance    = a.enable_performance    && b.enable_performance;
        enable_wlb            = a.enable_wlb            && b.enable_wlb;
        enable_rbac           = a.enable_rbac           && b.enable_rbac;
+       enable_dmc            = a.enable_dmc            && b.enable_dmc;
        restrict_connection   = a.restrict_connection   || 
b.restrict_connection;
        platform_filter       = a.platform_filter       || b.platform_filter;
        regular_nag_dialog    = a.regular_nag_dialog    || b.regular_nag_dialog;
@@ -137,6 +141,7 @@
 let _restrict_historical_performance = "restrict_historical_performance"
 let _restrict_wlb = "restrict_wlb"
 let _restrict_rbac = "restrict_rbac"
+let _restrict_dmc = "restrict_dmc"
 let _regular_nag_dialog = "regular_nag_dialog"
 
 let to_assoc_list (x: restrictions) = [
@@ -154,6 +159,7 @@
        (_restrict_historical_performance, string_of_bool (not 
x.enable_performance   ));
        (_restrict_wlb,                    string_of_bool (not x.enable_wlb     
      ));
        (_restrict_rbac,                   string_of_bool (not x.enable_rbac    
      ));
+       (_restrict_dmc,                    string_of_bool (not x.enable_dmc     
      ));
        (_regular_nag_dialog,              string_of_bool (    
x.regular_nag_dialog   ));
 ]
 
@@ -177,6 +183,7 @@
                enable_performance    = Opt.default 
most_permissive.enable_performance    (Opt.map not (find bool_of_string 
_restrict_historical_performance));
                enable_wlb            = Opt.default most_permissive.enable_wlb  
          (Opt.map not (find bool_of_string _restrict_wlb));
                enable_rbac           = Opt.default most_permissive.enable_rbac 
          (Opt.map not (find bool_of_string _restrict_rbac));
+               enable_dmc            = Opt.default most_permissive.enable_dmc  
          (Opt.map not (find bool_of_string _restrict_dmc));
                regular_nag_dialog    = Opt.default 
most_permissive.regular_nag_dialog                 (find bool_of_string 
_regular_nag_dialog);
        }
 
@@ -197,6 +204,7 @@
        enable_performance    = false;
        enable_wlb            = false;
        enable_rbac           = false;
+       enable_dmc            = false;
        regular_nag_dialog    = true;
 }
 
@@ -217,6 +225,7 @@
                        enable_performance = true;
                        enable_wlb         = true;
                        enable_rbac        = true;
+                       enable_dmc         = true;
                        regular_nag_dialog = false;
                }
 
@@ -248,3 +257,6 @@
 
 let license_ok_for_rbac ~__context =
        (get_pool()).enable_rbac
+
+let context_ok_for_dmc ~__context =
+       (get_pool()).enable_dmc
diff -r e61b811f0c2c -r 9322132154fe ocaml/license/restrictions.mli
--- a/ocaml/license/restrictions.mli    Mon Feb 01 15:59:05 2010 +0000
+++ b/ocaml/license/restrictions.mli    Mon Feb 01 16:31:16 2010 +0000
@@ -45,6 +45,7 @@
        enable_performance    : bool; (** used by XenCenter? *)
        enable_wlb            : bool; (** enable Workload Balancing (WLB) *)
        enable_rbac           : bool; (** enable Role-Based Access Control 
(RBAC) *)
+       enable_dmc            : bool; (** enable Dynamic Memory Control (DMC) *)
        restrict_connection   : bool; (** not used anymore; perhaps XenCenter 
does? *)
        platform_filter       : bool; (** filter platform data on domain 
create? *)
        regular_nag_dialog    : bool; (** used by XenCenter *)
@@ -82,3 +83,6 @@
 (** Checks whether we are entitled to enable Role-Based Access Control (RBAC) 
in the pool *)
 val license_ok_for_rbac : __context:'a -> bool
 
+(** Checks whether we are entitled to enable Dynamic Memory Control (DMC)
+  * in the pool. *)
+val context_ok_for_dmc : __context:'a -> bool
2 files changed, 16 insertions(+)
ocaml/license/restrictions.ml  |   12 ++++++++++++
ocaml/license/restrictions.mli |    4 ++++


Attachment: xen-api.hg-12.patch
Description: Text Data

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
<Prev in Thread] Current Thread [Next in Thread>