[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-API] [PATCH] [CA-36287] Makes it possible use various memory-related API functions to configure templates. Extends the "vm-memory-limits-set", "vm-memory-dynamic-range-set" and "vm-memory-static-range-set" functions to accept template UUIDs



# HG changeset patch
# User Jonathan Knowles <jonathan.knowles@xxxxxxxxxxxxx>
# Date 1265132601 0
# Node ID 50367754c206864b545e32e4cde1d746b374e4c9
# Parent  5c2ab1c86dc5b7a44491f440b26aa42d11703aa8
[CA-36287] Makes it possible use various memory-related API functions to 
configure templates. Extends the "vm-memory-limits-set", 
"vm-memory-dynamic-range-set" and "vm-memory-static-range-set" functions to 
accept template UUIDs.

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

diff -r 5c2ab1c86dc5 -r 50367754c206 ocaml/xapi/cli_operations.ml
--- a/ocaml/xapi/cli_operations.ml      Tue Feb 02 17:41:46 2010 +0000
+++ b/ocaml/xapi/cli_operations.ml      Tue Feb 02 17:43:21 2010 +0000
@@ -1769,20 +1769,24 @@
 let vm_memory_dynamic_range_set printer rpc session_id params = 
        let min = Record_util.bytes_of_string "min" (List.assoc "min" params)
        and max = Record_util.bytes_of_string "max" (List.assoc "max" params) in
-       ignore (do_vm_op ~include_control_vms:true printer rpc session_id
-       (fun vm ->
-               Client.VM.set_memory_dynamic_range rpc session_id
-                       (vm.getref ()) min max) params ["min"; "max"]
-       )
+       ignore
+               (do_vm_op ~include_control_vms:true ~include_template_vms:true
+                       printer rpc session_id
+                       (fun vm ->
+                               Client.VM.set_memory_dynamic_range rpc 
session_id
+                                       (vm.getref ()) min max)
+                       params ["min"; "max"])
 
 let vm_memory_static_range_set printer rpc session_id params =
        let min = Record_util.bytes_of_string "min" (List.assoc "min" params)
        and max = Record_util.bytes_of_string "max" (List.assoc "max" params) in
-       ignore (do_vm_op ~include_control_vms:true printer rpc session_id
-       (fun vm ->
-               Client.VM.set_memory_static_range rpc session_id
-                       (vm.getref ()) min max) params ["min"; "max"]
-       )
+       ignore
+               (do_vm_op ~include_control_vms:true ~include_template_vms:true
+                       printer rpc session_id
+                       (fun vm ->
+                               Client.VM.set_memory_static_range rpc session_id
+                                       (vm.getref ()) min max)
+                       params ["min"; "max"])
 
 let vm_memory_limits_set printer rpc session_id params =
        let extract key =
@@ -1791,13 +1795,13 @@
        and static_max = extract "static-max"
        and dynamic_min = extract "dynamic-min"
        and dynamic_max = extract "dynamic-max" in
-       ignore (
-               do_vm_op ~include_control_vms:true printer rpc session_id
+       ignore
+               (do_vm_op ~include_control_vms:true ~include_template_vms:true
+                       printer rpc session_id
                        (fun vm ->
                                Client.VM.set_memory_limits rpc session_id 
(vm.getref ())
                                        static_min static_max dynamic_min 
dynamic_max)
-                       params ["static-min"; "static-max"; "dynamic-min"; 
"dynamic-max"]
-       )
+                       params ["static-min"; "static-max"; "dynamic-min"; 
"dynamic-max"])
 
 let vm_memory_target_set printer rpc session_id params = 
        let target = Record_util.bytes_of_string "target"
1 file changed, 18 insertions(+), 14 deletions(-)
ocaml/xapi/cli_operations.ml |   32 ++++++++++++++++++--------------


Attachment: xen-api.hg.patch
Description: Text Data

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.