From: Vincent Hanquez Date: Thu, 23 Jul 2009 13:20:41 +0000 (+0100) Subject: use a specific config reader for memory since the set/get expect a value in kilobytes X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=c6b34f1b8c17e6aba32f8b36e4d914ec27a64930;p=xenclient%2Ftoolstack.git use a specific config reader for memory since the set/get expect a value in kilobytes whereas the config file is in megabytes --- diff --git a/xenvm/vmconfig.ml b/xenvm/vmconfig.ml index 2493419..dcd5f8a 100644 --- a/xenvm/vmconfig.ml +++ b/xenvm/vmconfig.ml @@ -466,6 +466,7 @@ let of_file uuid error_report file = and debug = ref (!cfg.debug) and output = ref (!cfg.output) and no_mem_check = ref (!cfg.no_mem_check) + and memory = ref (-1) in let set_action ref_var s = @@ -489,6 +490,7 @@ let of_file uuid error_report file = ("output", Config.Set_string output); ("uuid", Config.String (fun s -> __uuid := Some s)); ("debug", Config.Set_bool debug); + ("memory", Config.Set_int memory); ("no_mem_check", Config.Set_bool no_mem_check); ] in let kv k v = @@ -505,10 +507,10 @@ let of_file uuid error_report file = with Config.Error ls -> error_report ls end; - { !cfg with __uuid = !__uuid; debug = !debug; + memory = Int64.mul (Int64.of_int !memory) 1024L; startup = !startup; output = !output; no_mem_check = !no_mem_check;