diff --git a/tools/ocaml/xenstored/connection.ml b/tools/ocaml/xenstored/connection.ml index d11011e164..37eb2444b9 100644 --- a/tools/ocaml/xenstored/connection.ml +++ b/tools/ocaml/xenstored/connection.ml @@ -148,13 +148,11 @@ let mark_as_bad con = let initial_next_tid = 1 let do_reconnect con = + (* transactions and watches handled by caller *) Xenbus.Xb.reconnect con.xb; (* dom is the same *) - Hashtbl.clear con.transactions; con.next_tid <- initial_next_tid; - Hashtbl.clear con.watches; (* anonid is the same *) - con.nb_watches <- 0; con.stat_nb_ops <- 0; (* perm is the same *) () diff --git a/tools/ocaml/xenstored/process.ml b/tools/ocaml/xenstored/process.ml index bc68c54c9a..fc2558ac3d 100644 --- a/tools/ocaml/xenstored/process.ml +++ b/tools/ocaml/xenstored/process.ml @@ -345,15 +345,18 @@ let do_isintroduced con _t domains _cons data = in if domid = Define.domid_self || Domains.exist domains domid then "T\000" else "F\000" -(* only in xen >= 4.2 *) -let do_reset_watches con _t _domains cons _data = +let reset_watches_and_transactions cons con = Connections.del_watches cons con; - Connection.del_transactions con + Connection.del_transactions con; + History.trim () + +let do_reset_watches con _t _domains cons _data = + reset_watches_and_transactions cons con let do_reconnect cons con = let domstr = Connection.get_domstr con in info "%s requests a reconnect" domstr; - History.trim (); + reset_watches_and_transactions cons con; Connection.do_reconnect con; info "%s reconnection complete" domstr