git.annexia.org
/
ocaml-libvirt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Expose Secret API
[ocaml-libvirt.git]
/
examples
/
get_all_domain_stats.ml
diff --git
a/examples/get_all_domain_stats.ml
b/examples/get_all_domain_stats.ml
index
cc86da6
..
68b7160
100644
(file)
--- a/
examples/get_all_domain_stats.ml
+++ b/
examples/get_all_domain_stats.ml
@@
-8,10
+8,11
@@
open Printf
module C = Libvirt.Connect
module D = Libvirt.Domain
module C = Libvirt.Connect
module D = Libvirt.Domain
-let print_stats stats =
+let print_stats
conn
stats =
try
Array.iter (
try
Array.iter (
- fun { D.dom = dom; D.params = params } ->
+ fun { D.dom_uuid = uuid; D.params = params } ->
+ let dom = D.lookup_by_uuid conn uuid in
printf "domain %s:\n" (D.get_name dom);
Array.iteri (
fun i (field, value) ->
printf "domain %s:\n" (D.get_name dom);
Array.iteri (
fun i (field, value) ->
@@
-38,7
+39,7
@@
let () =
exit 1
);
exit 1
);
- let conn = C.connect_
readonly (
) in
+ let conn = C.connect_
auth_readonly (C.get_auth_default ()
) in
let what = [
D.StatsState;
let what = [
D.StatsState;
@@
-55,7
+56,7
@@
let () =
while not !quit do
let stats = D.get_all_domain_stats conn what who in
while not !quit do
let stats = D.get_all_domain_stats conn what who in
- if stats <> [||] then print_stats stats
+ if stats <> [||] then print_stats
conn
stats
else (
printf "no guests found\n";
quit := true
else (
printf "no guests found\n";
quit := true