]> xenbits.xensource.com Git - xenclient/toolstack.git/commitdiff
add a way to specify which monitor to start. dbus and/or unix_json.
authorVincent Hanquez <vincent.hanquez@eu.citrix.com>
Thu, 13 Aug 2009 10:00:26 +0000 (11:00 +0100)
committerVincent Hanquez <vincent.hanquez@eu.citrix.com>
Thu, 13 Aug 2009 10:00:26 +0000 (11:00 +0100)
xenvm/vmstate.ml
xenvm/xenvm.ml

index 1283c2b92f5ad63e4d66dbb40f726be157e54b3f..d39ec7a6c483794d7e7198313f50eb700ce69624 100644 (file)
@@ -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;
 }
index 8a7143fe9b4b1e0f0c8b10c7e6a30cb2399c6063..01789e8807fa506c68387e1c0124ecbed25c8b88 100644 (file)
@@ -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 <config>] [--uuid <uuid>] [<config>-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 ();