diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2008-04-16 13:51:14 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2008-04-16 13:51:14 +0100 |
commit | 02f1c03c9f81e25353aae4900ce19e194b507f71 (patch) | |
tree | 99d5b8e8976698b92c914da1ce7220b1c91a5559 /examples/node_info.ml | |
parent | 0bdb08c61ec66a16a81c2778a2a76cac77b08fda (diff) | |
download | virt-top-02f1c03c9f81e25353aae4900ce19e194b507f71.tar.gz virt-top-02f1c03c9f81e25353aae4900ce19e194b507f71.tar.xz virt-top-02f1c03c9f81e25353aae4900ce19e194b507f71.zip |
Removed virt-ctrl, virt-df, ocaml-libvirt - now in separate repositories.
Diffstat (limited to 'examples/node_info.ml')
-rw-r--r-- | examples/node_info.ml | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/examples/node_info.ml b/examples/node_info.ml deleted file mode 100644 index c52615e..0000000 --- a/examples/node_info.ml +++ /dev/null @@ -1,48 +0,0 @@ -(* Simple demo program showing node info. - Usage: node_info [URI] - (C) Copyright 2007 Richard W.M. Jones, Red Hat Inc. - http://libvirt.org/ - *) - -open Printf - -module C = Libvirt.Connect - -let () = - try - let name = - if Array.length Sys.argv >= 2 then - Some (Sys.argv.(1)) - else - None in - let conn = C.connect_readonly ?name () in - - (* Get node_info, hostname, etc. *) - let node_info = C.get_node_info conn in - - printf "model = %s\n" node_info.C.model; - printf "memory = %Ld K\n" node_info.C.memory; - printf "cpus = %d\n" node_info.C.cpus; - printf "mhz = %d\n" node_info.C.mhz; - printf "nodes = %d\n" node_info.C.nodes; - printf "sockets = %d\n" node_info.C.sockets; - printf "cores = %d\n" node_info.C.cores; - printf "threads = %d\n%!" node_info.C.threads; - - let hostname = C.get_hostname conn in - - printf "hostname = %s\n%!" hostname; - - let uri = C.get_uri conn in - - printf "uri = %s\n%!" uri - - with - Libvirt.Virterror err -> - eprintf "error: %s\n" (Libvirt.Virterror.to_string err) - -let () = - (* Run the garbage collector which is a good way to check for - * memory corruption errors and reference counting issues in libvirt. - *) - Gc.compact () |