Skip to content
This repository
Browse code

[squeezed] allow "balance-check-interval" to be set via config file

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
  • Loading branch information...
commit abffea91c760e2a33b45a34a97a5ff4b40c053cc 1 parent 31a2035
Dave Scott authored May 14, 2012
5  ocaml/xapi/xapi_globs.ml
@@ -607,9 +607,6 @@ let master_connection_default_timeout = ref 10.
607 607
 
608 608
 let qemu_dm_ready_timeout = ref 300.
609 609
 
610  
-(* seconds per balancing check *)
611  
-let squeezed_balance_check_interval = ref 10.
612  
-
613 610
 (* Time we allow for the hotplug scripts to run before we assume something bad
614 611
    has happened and abort *)
615 612
 let hotplug_timeout = ref 300.
@@ -717,8 +714,6 @@ let xapi_globs_spec =
717 714
 	  Config.Set_float master_connection_default_timeout;
718 715
 	  "qemu_dm_ready_timeout",
719 716
 	  Config.Set_float qemu_dm_ready_timeout;
720  
-	  "squeezed_balance_check_interval",
721  
-	  Config.Set_float squeezed_balance_check_interval;
722 717
 	  "hotplug_timeout",
723 718
 	  Config.Set_float hotplug_timeout;
724 719
 	  "pif_reconfigure_ip_timeout",
4  ocaml/xenops/squeezed.ml
@@ -32,11 +32,13 @@ let config_file = ref (Printf.sprintf "/etc/%s.conf" name)
32 32
 let pidfile = ref (Printf.sprintf "/var/run/%s.pid" name)
33 33
 let log_destination = ref "syslog:daemon"
34 34
 let daemon = ref false
  35
+let balance_check_interval = ref 10.
35 36
 
36 37
 let config_spec = [
37 38
 	"pidfile", Config.Set_string pidfile;
38 39
 	"log", Config.Set_string log_destination;
39 40
 	"daemon", Config.Set_bool daemon;
  41
+	"balance-check-interval", Config.Set_float balance_check_interval;
40 42
 	"disable-logging-for", Config.String
41 43
 		(fun x ->
42 44
 			try
@@ -329,7 +331,7 @@ let _ =
329 331
   Unixext.mkdir_rec (Filename.dirname !pidfile) 0o755;
330 332
   Unixext.pidfile_write !pidfile;
331 333
 
332  
-	debug "Starting daemon listening on %s with idle_timeout = %.0f" _service !Xapi_globs.squeezed_balance_check_interval;
  334
+	debug "Starting daemon listening on %s with idle_timeout = %.0f" _service !balance_check_interval;
333 335
 
334 336
 	let module Server = Memory_interface.Server(Memory_server) in
335 337
 	Debug.with_thread_associated "main" (start sockets) Server.process;
4  scripts/squeezed.conf
@@ -5,3 +5,7 @@ pidfile=/var/run/squeezed.pid
5 5
 
6 6
 # Omit some sources of log-spam by default
7 7
 disable-logging-for=http
  8
+
  9
+# Host memory will be re-examined and possibly re-balanced
  10
+# every balance-check-interval
  11
+balance-check-interval=10

0 notes on commit abffea9

Please sign in to comment.
Something went wrong with that request. Please try again.