summaryrefslogtreecommitdiffstats
path: root/virt-top/virt_top.ml
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2007-09-19 19:17:40 +0100
committerRichard W.M. Jones <rjones@redhat.com>2007-09-19 19:17:40 +0100
commit17777061b8970d1bd528e2b5ddf35da68808326b (patch)
tree779f05437912919e1eb2535046004ac73e1d1a5f /virt-top/virt_top.ml
parentf1f314e84bd2daef18b983eb1c2e10a7614c57bb (diff)
downloadvirt-top-17777061b8970d1bd528e2b5ddf35da68808326b.tar.gz
virt-top-17777061b8970d1bd528e2b5ddf35da68808326b.tar.xz
virt-top-17777061b8970d1bd528e2b5ddf35da68808326b.zip
* virt-top/virt_top.ml: Ignore transient error from
C.num_of_defined_domains when it cannot contact xend; that was causing virt-top to exit when xend was restarted.
Diffstat (limited to 'virt-top/virt_top.ml')
-rw-r--r--virt-top/virt_top.ml17
1 files changed, 12 insertions, 5 deletions
diff --git a/virt-top/virt_top.ml b/virt-top/virt_top.ml
index e2a7435..a621a18 100644
--- a/virt-top/virt_top.ml
+++ b/virt-top/virt_top.ml
@@ -486,11 +486,18 @@ let redraw, clear_pcpu_display_data =
) ids in
(* Inactive domains. *)
- let n = C.num_of_defined_domains conn in
- let names =
- if n > 0 then Array.to_list (C.list_defined_domains conn n)
- else [] in
- let doms_inactive = List.map (fun name -> name, Inactive) names in
+ let doms_inactive =
+ try
+ let n = C.num_of_defined_domains conn in
+ let names =
+ if n > 0 then Array.to_list (C.list_defined_domains conn n)
+ else [] in
+ List.map (fun name -> name, Inactive) names
+ with
+ (* Ignore transient errors, in particular errors from
+ * num_of_defined_domains if it cannot contact xend.
+ *)
+ | Libvirt.Virterror _ -> [] in
doms @ doms_inactive in