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
Add support for virConnectListAllDomains call.
[ocaml-libvirt.git]
/
mlvirsh
/
mlvirsh.ml
diff --git
a/mlvirsh/mlvirsh.ml
b/mlvirsh/mlvirsh.ml
index
4c77e7f
..
9fd3779
100644
(file)
--- a/
mlvirsh/mlvirsh.ml
+++ b/
mlvirsh/mlvirsh.ml
@@
-302,8
+302,8
@@
let do_command =
| D.VcpuRunning -> s_"running"
| D.VcpuBlocked -> s_"blocked"
in
| D.VcpuRunning -> s_"running"
| D.VcpuBlocked -> s_"blocked"
in
- let print_domain_
array
doms =
-
Array
.iter (
+ let print_domain_
list
doms =
+
List
.iter (
fun dom ->
let id =
try sprintf "%d" (D.get_id dom)
fun dom ->
let id =
try sprintf "%d" (D.get_id dom)
@@
-576,21
+576,17
@@
let do_command =
s_"Print the hostname.",
[];
"list",
s_"Print the hostname.",
[];
"list",
- cmd0 print_domain_
array
+ cmd0 print_domain_
list
(fun () ->
let c = get_readonly_connection () in
(fun () ->
let c = get_readonly_connection () in
- let n = C.num_of_domains c in
- let domids = C.list_domains c n in
- Array.map (D.lookup_by_id c) domids),
+ fst (Libvirt.get_domains c ~want_info:false [D.ListActive])),
s_"List the running domains.",
[];
"list-defined",
s_"List the running domains.",
[];
"list-defined",
- cmd0 print_domain_
array
+ cmd0 print_domain_
list
(fun () ->
let c = get_readonly_connection () in
(fun () ->
let c = get_readonly_connection () in
- let n = C.num_of_defined_domains c in
- let domnames = C.list_defined_domains c n in
- Array.map (D.lookup_by_name c) domnames),
+ fst (Libvirt.get_domains c ~want_info:false [D.ListInactive])),
s_"List the defined but not running domains.",
[];
"quit",
s_"List the defined but not running domains.",
[];
"quit",