- let have_list_all_domains = check_have_list_all_domains conn in
-
- if have_list_all_domains then (
- (* Good, we can use the shiny new method. *)
- let doms, infos = list_all_domains conn ~want_info:true flags in
- let doms = Array.to_list doms and infos = Array.to_list infos in
- List.combine doms infos
- )
- else (
- (* Old/slow/inefficient method. *)
- let get_active, get_inactive =
- if List.mem ListAll flags then
- (true, true)
- else (List.mem ListActive flags, List.mem ListInactive flags) in
- let active_doms =
- if get_active then (
- let n = Connect.num_of_domains conn in
- let ids = Connect.list_domains conn n in
- let ids = Array.to_list ids in
- map_ignore_errors (lookup_by_id conn) ids
- ) else [] in
-
- let inactive_doms =
- if get_inactive then (
- let n = Connect.num_of_defined_domains conn in
- let names = Connect.list_defined_domains conn n in
- let names = Array.to_list names in
- map_ignore_errors (lookup_by_name conn) names
- ) else [] in
-
- let doms = active_doms @ inactive_doms in
-
- map_ignore_errors (fun dom -> (dom, get_info dom)) doms
- )
+ (* Old/slow/inefficient method. *)
+ let get_active, get_inactive =
+ if List.mem ListAll flags then
+ (true, true)
+ else (List.mem ListActive flags, List.mem ListInactive flags) in
+ let active_doms =
+ if get_active then (
+ let n = Connect.num_of_domains conn in
+ let ids = Connect.list_domains conn n in
+ let ids = Array.to_list ids in
+ map_ignore_errors (lookup_by_id conn) ids
+ ) else [] in
+
+ let inactive_doms =
+ if get_inactive then (
+ let n = Connect.num_of_defined_domains conn in
+ let names = Connect.list_defined_domains conn n in
+ let names = Array.to_list names in
+ map_ignore_errors (lookup_by_name conn) names
+ ) else [] in
+
+ let doms = active_doms @ inactive_doms in
+
+ map_ignore_errors (fun dom -> (dom, get_info dom)) doms