) nodes in
List.map (fun s -> Marshal.from_bytes s 0) active_guests
+let find_guest ?verbose ?(nodes = Mclu_conf.nodes ()) name =
+ let host, name = name_parse name in
+ let node =
+ match host with
+ | Some host ->
+ (try List.find (fun n -> host = n.Mclu_conf.hostname) nodes
+ with Not_found ->
+ eprintf "mclu: host '%s' not found\n" host;
+ exit 1)
+ | None ->
+ (* No 'host:' prefix given, so we need to find the host. *)
+ let guests = active_guests ?verbose ~nodes () in
+ let node, _ =
+ try
+ List.find (
+ fun (node, doms) ->
+ List.exists (fun dom -> name = dom.dom_name) doms
+ ) guests
+ with
+ Not_found ->
+ eprintf "mclu: guest '%s' not found\n" name;
+ exit 1 in
+ node in
+ node, name
+
let list ~verbose () =
let list_what = !list_what in