]> xenbits.xen.org Git - xenclient/toolstack.git/commitdiff
[xenvm] Couple small changes
authorTomasz Wroblewski <tomasz.wroblewski@citrix.com>
Tue, 12 Jan 2010 12:41:08 +0000 (12:41 +0000)
committerTomasz Wroblewski <tomasz.wroblewski@citrix.com>
Tue, 12 Jan 2010 12:42:42 +0000 (12:42 +0000)
- Emit a notification when dbus rpc interface is ready to receive calls
- Fork demon process only after checking for exisiting xenvm instance,
  so the client actually gets proper exit code as supposed

xenvm/xenvm.ml

index eb90616bbd377ca6a8c2fee7c87998ccccdc153e..b31df632ad8344e182075cd35bcce6b2bea64856 100644 (file)
@@ -831,6 +831,8 @@ let monitor_rpc_dbus state =
                                      "expecting string method followed by dictionnary" in
                        Some (err_msg)
                in
+       (* notify that dbus RPC is up and running *)
+       Vmact.notify state Xenvmlib.code_ping [ "dbus-rpc-up" ];
 
        while not state.vm_monitors.monitor_dbus_quit do
                (* check for outgoing work *)
@@ -1013,9 +1015,6 @@ let () =
        state.vm_monitors.monitor_use_dbus_session <- !monitor_dbus_session;
        state.vm_monitors.monitor_use_json <- !monitor_json;
 
-       if !daemonize then
-               Unixext.daemonize ();
-
        let glob_debug = try Some (Sys.getenv "XENVM_DEBUG") with Not_found -> None in
        if state.vm_cfg.debug || glob_debug <> None then (
                let a =
@@ -1046,4 +1045,6 @@ let () =
        );
 
        check_vm uuid;
+       if !daemonize then
+               Unixext.daemonize ();
        main state