}
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;
}
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 [
("--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 (
exit 2
);
*)
+ state.vm_monitors.monitor_use_dbus <- !monitor_dbus;
+ state.vm_monitors.monitor_use_json <- !monitor_json;
if !daemonize then
Unixext.daemonize ();