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] [CA-34305] Enables the set-memory-limits call for VM t

To: xen-api <xen-api@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-API] [PATCH] [CA-34305] Enables the set-memory-limits call for VM templates.
From: Jonathan Knowles <jonathan.knowles@xxxxxxxxxxxxx>
Date: Tue, 3 Nov 2009 16:12:54 +0000
Delivery-date: Tue, 03 Nov 2009 08:12:56 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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>
[CA-34305] Enables the set-memory-limits call for VM templates.

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

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])
 

Attachment: CA-34305
Description: Text document

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-API] [PATCH] [CA-34305] Enables the set-memory-limits call for VM templates., Jonathan Knowles <=