Skip to content

Commit 092c2de

Browse files
committed
CP-1589: Add restrict_vswitch_controller
Include a restrictions option to control the use of the vswitch controller. Signed-off-by: Rob Hoes <[email protected]>
1 parent bc78726 commit 092c2de

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

ocaml/license/restrictions.ml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ type restrictions = {
5353
enable_wlb : bool;
5454
enable_rbac : bool;
5555
enable_dmc : bool;
56+
enable_vswitch_controller : bool;
5657
restrict_connection : bool;
5758
platform_filter : bool;
5859
regular_nag_dialog : bool;
@@ -74,6 +75,7 @@ let to_compact_string (x: restrictions) =
7475
"WLB" , x.enable_wlb ;
7576
"RBAC" , x.enable_rbac ;
7677
"DMC" , x.enable_dmc ;
78+
"DVSC" , x.enable_vswitch_controller;
7779
"Cnx" , not x.restrict_connection ;
7880
"Plat" , not x.platform_filter ;
7981
"nag" , x.regular_nag_dialog ;
@@ -97,6 +99,7 @@ let most_permissive = {
9799
enable_wlb = true;
98100
enable_rbac = true;
99101
enable_dmc = true;
102+
enable_vswitch_controller = true;
100103
restrict_connection = false;
101104
platform_filter = false;
102105
regular_nag_dialog = false;
@@ -118,6 +121,7 @@ let least_permissive (a: restrictions) (b: restrictions) = {
118121
enable_wlb = a.enable_wlb && b.enable_wlb;
119122
enable_rbac = a.enable_rbac && b.enable_rbac;
120123
enable_dmc = a.enable_dmc && b.enable_dmc;
124+
enable_vswitch_controller = a.enable_vswitch_controller && b.enable_vswitch_controller;
121125
restrict_connection = a.restrict_connection || b.restrict_connection;
122126
platform_filter = a.platform_filter || b.platform_filter;
123127
regular_nag_dialog = a.regular_nag_dialog || b.regular_nag_dialog;
@@ -147,6 +151,7 @@ let _restrict_historical_performance = "restrict_historical_performance"
147151
let _restrict_wlb = "restrict_wlb"
148152
let _restrict_rbac = "restrict_rbac"
149153
let _restrict_dmc = "restrict_dmc"
154+
let _restrict_vswitch_controller = "restrict_vswitch_controller"
150155
let _regular_nag_dialog = "regular_nag_dialog"
151156

152157
let to_assoc_list (x: restrictions) =
@@ -165,6 +170,7 @@ let to_assoc_list (x: restrictions) =
165170
(_restrict_wlb, string_of_bool (not x.enable_wlb));
166171
(_restrict_rbac, string_of_bool (not x.enable_rbac));
167172
(_restrict_dmc, string_of_bool (not x.enable_dmc ));
173+
(_restrict_vswitch_controller, string_of_bool (not x.enable_vswitch_controller ));
168174
(_regular_nag_dialog, string_of_bool x.regular_nag_dialog);
169175
]
170176

@@ -188,6 +194,7 @@ let of_assoc_list x =
188194
enable_wlb = Opt.default most_permissive.enable_wlb (Opt.map not (find bool_of_string _restrict_wlb));
189195
enable_rbac = Opt.default most_permissive.enable_rbac (Opt.map not (find bool_of_string _restrict_rbac));
190196
enable_dmc = Opt.default most_permissive.enable_dmc (Opt.map not (find bool_of_string _restrict_dmc));
197+
enable_vswitch_controller = Opt.default most_permissive.enable_dmc (Opt.map not (find bool_of_string _restrict_vswitch_controller));
191198
regular_nag_dialog = Opt.default most_permissive.regular_nag_dialog (find bool_of_string _regular_nag_dialog);
192199
}
193200

@@ -210,6 +217,7 @@ let common_to_all_skus =
210217
enable_wlb = false;
211218
enable_rbac = false;
212219
enable_dmc = false;
220+
enable_vswitch_controller = false;
213221
regular_nag_dialog = true;
214222
}
215223

@@ -231,6 +239,7 @@ let rec restrictions_of_sku = function
231239
enable_wlb = true;
232240
enable_rbac = true;
233241
enable_dmc = true;
242+
enable_vswitch_controller = true;
234243
regular_nag_dialog = false;
235244
}
236245

@@ -263,3 +272,6 @@ let license_ok_for_rbac ~__context =
263272

264273
let context_ok_for_dmc ~__context =
265274
(get_pool()).enable_dmc
275+
276+
let license_ok_for_dmc ~__context =
277+
(get_pool()).enable_vswitch_controller

ocaml/license/restrictions.mli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ type restrictions = {
4646
enable_wlb : bool; (** enable Workload Balancing (WLB) *)
4747
enable_rbac : bool; (** enable Role-Based Access Control (RBAC) *)
4848
enable_dmc : bool; (** enable Dynamic Memory Control (DMC) *)
49+
enable_vswitch_controller : bool; (** enable use of a Distributed VSwitch (DVS) Controller *)
4950
restrict_connection : bool; (** not used anymore; perhaps XenCenter does? *)
5051
platform_filter : bool; (** filter platform data on domain create? *)
5152
regular_nag_dialog : bool; (** used by XenCenter *)

0 commit comments

Comments
 (0)