# HG changeset patch # User Jonathan Knowles [CA-34305] Enables the set-memory-limits call for VM templates. Signed-off-by: Jonathan Knowles diff -r 59da465cfc7f ocaml/xapi/xapi_vm_lifecycle.ml --- a/ocaml/xapi/xapi_vm_lifecycle.ml Wed Oct 28 14:30:38 2009 +0000 +++ b/ocaml/xapi/xapi_vm_lifecycle.ml Wed Oct 28 14:55:08 2009 +0000 @@ -160,9 +160,20 @@ List.mem_assoc Xapi_globs.default_template_key vmr.Db_actions.vM_other_config && (List.assoc Xapi_globs.default_template_key vmr.Db_actions.vM_other_config) = "true" in + let allowed_operations = [ + `changing_dynamic_range; + `changing_static_range; + `changing_memory_limits; + `clone; + `copy; + `create_template; + `export; + `metadata_export; + `provision; + ] in if false - || List.mem op [`clone; `copy; `export; `provision; `metadata_export; `create_template; `changing_dynamic_range; `changing_static_range] - || (op = `destroy && not default_template) + || List.mem op allowed_operations + || (op = `destroy && not default_template) then None else Some (Api_errors.vm_is_template, [ref_str; Record_util.vm_operation_to_string op])