From 2a128db5bb37fc904f611d1344adf5d743e1b0db Mon Sep 17 00:00:00 2001 From: "rjones@thinkpad.home.annexia.org" Date: Fri, 18 Apr 2008 14:40:56 +0100 Subject: [PATCH] Throwing Invalid_argument(...#iter_children) caused the connection to be recreated over and over again. --- virt-ctrl/vc_connections.ml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/virt-ctrl/vc_connections.ml b/virt-ctrl/vc_connections.ml index 8f5fba0..03d06ac 100644 --- a/virt-ctrl/vc_connections.ml +++ b/virt-ctrl/vc_connections.ml @@ -116,7 +116,7 @@ and inactive = string (* domain's name *) *) type columns = string GTree.column * string GTree.column * string GTree.column * string GTree.column * string GTree.column * int GTree.column -let debug_repopulate = false +let debug_repopulate = true (* Populate the tree with the current list of connections, domains. * This function is called once per second. @@ -154,7 +154,7 @@ let repopulate (tree : GTree.view) (model : GTree.tree_store) model#set ~row ~column:col_name_id name; model#set ~row ~column:col_id conn_id; (* Expand the new row. *) - (* XXX This doesn't work, why? - Because we haven't create subrows yet.*) + (* XXX This doesn't work, why? - Because we haven't created subrows yet.*) tree#expand_row (model#get_path row) ) added; @@ -340,7 +340,11 @@ let repopulate (tree : GTree.view) (model : GTree.tree_store) dh.hist_posn <- dh.hist_posn+1 with - Libvirt.Virterror _ -> () (* Ignore any transient error *) + (* Ignore any transient error *) + | Libvirt.Virterror err -> + prerr_endline (Libvirt.Virterror.to_string err) + | Failure msg | Invalid_argument msg -> + prerr_endline msg ) ) (model#iter_children (Some parent)); @@ -355,7 +359,7 @@ let repopulate (tree : GTree.view) (model : GTree.tree_store) | Libvirt.Virterror err -> prerr_endline (Libvirt.Virterror.to_string err); conn_id, (old_active, old_inactive) - | Failure msg -> + | Failure msg | Invalid_argument msg -> prerr_endline msg; conn_id, (old_active, old_inactive) ) conns in -- 1.8.3.1