Commit cced4c39 authored by Iustin Pop's avatar Iustin Pop
Browse files

Validate the os-specific hypervisor parameters

This adds a validation similar to the one for cluster-wide hypervisor
Signed-off-by: default avatarIustin Pop <>
Reviewed-by: default avatarRené Nussbaumer <>
parent 7b64b9ea
......@@ -2110,6 +2110,20 @@ class LUSetClusterParams(LogicalUnit):
_CheckHVParams(self, node_list, hv_name, hv_params)
if self.op.os_hvp:
# no need to check any newly-enabled hypervisors, since the
# defaults have already been checked in the above code-block
for os_name, os_hvp in self.new_os_hvp.items():
for hv_name, hv_params in os_hvp.items():
utils.ForceDictType(hv_params, constants.HVS_PARAMETER_TYPES)
# we need to fill in the new os_hvp on top of the actual hv_p
cluster_defaults = self.new_hvparams.get(hv_name, {})
new_osp = objects.FillDict(cluster_defaults, hv_params)
hv_class = hypervisor.GetHypervisor(hv_name)
_CheckHVParams(self, node_list, hv_name, new_osp)
def Exec(self, feedback_fn):
"""Change the parameters of the cluster.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment