Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions xenvm/xenvm.ml
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,25 @@ let host_list config =

let shutdown config =
set_uri config None;
Lwt_main.run
(Client.shutdown ())
let t =
Client.shutdown ()
>>= fun () ->
(* wait for the daemon to disappear *)
let finished = ref false in
let rec wait () =
Lwt.catch
(fun () ->
Client.Host.all ()
>>= fun _ ->
Printf.fprintf stderr "Xenvmd is still alive: will sleep 5s and try again\n%!";
Lwt_unix.sleep 5.
) (fun _ ->
finished := true;
return ())
>>= fun () ->
if !finished then return () else wait () in
wait () in
Lwt_main.run t

let benchmark config =
set_uri config None;
Expand Down