diff options
author | cl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk> | 2005-09-19 14:47:56 +0000 |
---|---|---|
committer | cl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk> | 2005-09-19 14:47:56 +0000 |
commit | e83a8e7c2bd64d7f9ec296844e28f3c338645f95 (patch) | |
tree | 1300ef69b4cbd0d5176403749eabfd0727f1f17b /tools/xenstore/xenstored_watch.c | |
parent | e7dcd2ce65e37bc53b65d0af36a5da9d1747e643 (diff) | |
download | xen-e83a8e7c2bd64d7f9ec296844e28f3c338645f95.tar.gz xen-e83a8e7c2bd64d7f9ec296844e28f3c338645f95.tar.bz2 xen-e83a8e7c2bd64d7f9ec296844e28f3c338645f95.zip |
Fire watches once immediately upon registration.
It matches the model of programming used to avoid races with watches,
and also makes re-establishing watches on daemon restart easier.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
Diffstat (limited to 'tools/xenstore/xenstored_watch.c')
-rw-r--r-- | tools/xenstore/xenstored_watch.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/xenstore/xenstored_watch.c b/tools/xenstore/xenstored_watch.c index a543f8a495..74dd773694 100644 --- a/tools/xenstore/xenstored_watch.c +++ b/tools/xenstore/xenstored_watch.c @@ -236,6 +236,9 @@ void do_watch(struct connection *conn, struct buffered_data *in) trace_create(watch, "watch"); talloc_set_destructor(watch, destroy_watch); send_ack(conn, XS_WATCH); + + /* We fire once up front: simplifies clients and restart. */ + add_event(conn, watch, watch->node); } void do_watch_ack(struct connection *conn, const char *token) |