From 17777061b8970d1bd528e2b5ddf35da68808326b Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 1 Jan 1970 00:00:00 +0000 Subject: [PATCH] * 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. --- ChangeLog | 6 ++++++ virt-top/virt_top.ml | 17 ++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index dc30cd4..8cd4151 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-09-19 Richard Jones + + * 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. + 2007-09-18 Richard Jones * virt-df/virt_df.ml: Handle domains with partition-backed 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 -- 1.8.3.1