# HG changeset patch # User Jonathan Knowles # Date 1265039941 0 # Node ID 3aaa09cfd961b30c2d3af22e3b057d4c22203d9c # Parent 03168d007c006a76260daf2b7bd31a6f22b8209d [PCR0047] Renames function "VM_memory_constraints.valid" to "VM_memory_constraints.are_valid" in anticipation of using a common prefix for additional functions to be added in a further patch. Signed-off-by: Jonathan Knowles diff -r 03168d007c00 -r 3aaa09cfd961 ocaml/util/vm_memory_constraints.ml --- a/ocaml/util/vm_memory_constraints.ml Mon Feb 01 15:59:00 2010 +0000 +++ b/ocaml/util/vm_memory_constraints.ml Mon Feb 01 15:59:01 2010 +0000 @@ -56,7 +56,7 @@ (** Returns true if and only if the given memory constraints are in valid * order such that: static_min <= dynamic_min <= dynamic_max <= static_max *) - val valid : constraints:t -> bool + val are_valid : constraints:t -> bool (** Takes the given set of possibly-invalid memory constraints {i s}, and * returns a new set of valid and unballooned constraints {i t} s.t.: @@ -114,7 +114,7 @@ dynamic_max = dynamic_max; } - let valid ~constraints = + let are_valid ~constraints = Listext.List.is_sorted compare [ constraints.static_min; constraints.dynamic_min; diff -r 03168d007c00 -r 3aaa09cfd961 ocaml/xapi/xapi_vm.ml --- a/ocaml/xapi/xapi_vm.ml Mon Feb 01 15:59:00 2010 +0000 +++ b/ocaml/xapi/xapi_vm.ml Mon Feb 01 15:59:01 2010 +0000 @@ -139,7 +139,7 @@ static_min = min; static_max = max; } in - if not (Vm_memory_constraints.valid ~constraints) + if not (Vm_memory_constraints.are_valid ~constraints) then raise ( Api_errors.Server_error ( Api_errors.memory_constraint_violation, ["min or max"])); @@ -172,7 +172,7 @@ dynamic_max = dynamic_max; static_max = static_max; } in - if not (Vm_memory_constraints.valid ~constraints) + if not (Vm_memory_constraints.are_valid ~constraints) then raise (Api_errors.Server_error ( Api_errors.memory_constraint_violation, ["Memory limits must be in valid order: \ diff -r 03168d007c00 -r 3aaa09cfd961 ocaml/xapi/xapi_vm_helpers.ml --- a/ocaml/xapi/xapi_vm_helpers.ml Mon Feb 01 15:59:00 2010 +0000 +++ b/ocaml/xapi/xapi_vm_helpers.ml Mon Feb 01 15:59:01 2010 +0000 @@ -578,7 +578,7 @@ dynamic_min = min; target = min; dynamic_max = max } in - if not (Vm_memory_constraints.valid ~constraints) + if not (Vm_memory_constraints.are_valid ~constraints) then raise (Api_errors.Server_error(Api_errors.memory_constraint_violation, ["min or max"])); @@ -611,7 +611,7 @@ (* Make sure the new target is within the acceptable range. *) let constraints = Vm_memory_constraints.get_live ~__context ~vm_ref:self in let constraints = {constraints with Vm_memory_constraints.target = target} in - if not (Vm_memory_constraints.valid ~constraints) then raise ( + if not (Vm_memory_constraints.are_valid ~constraints) then raise ( Api_errors.Server_error ( Api_errors.memory_constraint_violation, ["invalid target"])); (* We've been forwarded, so the VM is local to this machine. *)