All users of the xenstore client do the following:
lwt client = make () in
immediate client (fun handle ->
read handle "foo"
where the make () step simply returns a cached global singleton multiplexing-client instance initialised on first use. We might as well instantiate this client automatically to simplify the user experience.
There's code in one or two apps to handle fork(). We should set the socket to close-on-exec and make the client reconnect automatically to cover this. If done sensibly, the reconnect logic would allow the daemon to be restarted without confusing the client.