Skip to content

Commit

Permalink
Merge pull request xapi-project#8 from djs55/forupstream/xenswitch
Browse files Browse the repository at this point in the history
Update to use message switch
  • Loading branch information
djs55 committed May 23, 2013
2 parents ef1af95 + bb04fbc commit 5805903
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
2 changes: 2 additions & 0 deletions src/memory_server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,5 @@ let balance_memory _ dbg =
)

let get_host_reserved_memory _ dbg = Squeeze_xen.target_host_free_mem_kib

let get_host_initial_free_memory _ dbg = 0L (* XXX *)
20 changes: 10 additions & 10 deletions src/squeezed.ml
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@ let _ =
debug "squeezed version %d.%d starting" major_version minor_version;

configure ~options ();
let socket = listen Memory_interface.json_path in

let module Server = Memory_interface.Server(Memory_server) in

let server = Xcp_service.make
~path:Memory_interface.json_path
~queue_name:Memory_interface.queue_name
~rpc_fn:(Server.process ())
() in

maybe_daemonize ();

(* Initialise the xenstore connection after daemonising, but before we make more threads *)
let _ = Squeezed_xenstore.get_client () in

let module Server = Memory_interface.Server(Memory_server) in

Memory_server.start_balance_thread balance_check_interval;
Squeeze_xen.Domain.start_watch_xenstore_thread ();

accept_forever socket
(fun this_connection ->
let context = () in
binary_handler Jsonrpc.call_of_string Jsonrpc.string_of_response Server.process (* no req *) this_connection context
);

wait_forever ()
Xcp_service.serve_forever server

0 comments on commit 5805903

Please sign in to comment.