1 (* 'top'-like tool for libvirt domains.
2 * $Id: virt_top_main.ml,v 1.2 2007/08/30 13:16:57 rjones Exp $
4 * Just contains the main function.
11 (* Note: make sure we catch any exceptions and clean up the display.
13 * Note (2): make sure all exit paths call the GC so that we can check
14 * that all allocated resources are being counted properly (by running
15 * the program under --debug ...).
18 let state = start_up () in
25 | Libvirt.Virterror err ->
27 prerr_endline (Libvirt.Virterror.to_string err);
31 prerr_endline ("Error: " ^ Printexc.to_string exn);
35 Gc.compact (); (* See note above. *)
37 exit (if error then 1 else 0)