From: Vincent Hanquez Date: Thu, 13 Aug 2009 10:00:26 +0000 (+0100) Subject: add a way to specify which monitor to start. dbus and/or unix_json. X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=7b70f14ac62001b72bd222b7c4229bf367710a13;p=xenclient%2Ftoolstack.git add a way to specify which monitor to start. dbus and/or unix_json. --- diff --git a/xenvm/vmstate.ml b/xenvm/vmstate.ml index 1283c2b..d39ec7a 100644 --- a/xenvm/vmstate.ml +++ b/xenvm/vmstate.ml @@ -40,8 +40,8 @@ type locks = { } type monitor_state = { - monitor_use_dbus: bool; - monitor_use_json: bool; + mutable monitor_use_dbus: bool; + mutable monitor_use_json: bool; mutable monitor_json_quit: bool; mutable monitor_dbus_quit: bool; } diff --git a/xenvm/xenvm.ml b/xenvm/xenvm.ml index 8a7143f..01789e8 100644 --- a/xenvm/xenvm.ml +++ b/xenvm/xenvm.ml @@ -859,6 +859,8 @@ let () = let config_errors = ref [] in let uuid = ref "" in let daemonize = ref true in + let monitor_dbus = ref false in + let monitor_json = ref true in let usage_msg = sprintf "usage: %s [--config ] [--uuid ] [-deprecated]" Sys.argv.(0) in Arg.parse [ @@ -866,6 +868,8 @@ let () = ("--uuid", Arg.Set_string uuid, "Force uuid to be the one specified"); ("--strict-config", Arg.Set strict_config, "Error out if the config contains errors"); ("--no-daemonize", Arg.Clear daemonize, "leave the daemon in foreground"); + ("--monitor-dbus", Arg.Bool (fun b -> monitor_dbus := b), "a monitor will listen on the dbus"); + ("--monitor-json", Arg.Bool (fun b -> monitor_json := b), "a monitor will listen on a unix/json interface"); ] (fun s -> anon := s :: !anon) usage_msg; if !config = "" && List.length !anon > 0 then ( @@ -913,6 +917,8 @@ let () = exit 2 ); *) + state.vm_monitors.monitor_use_dbus <- !monitor_dbus; + state.vm_monitors.monitor_use_json <- !monitor_json; if !daemonize then Unixext.daemonize ();