From 7c5ba0bb0081aa01853777533b0d2cf2d740b070 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Fri, 26 Oct 2007 11:48:58 +0100 Subject: [PATCH] Fire watch for non-dom0 backend when frontend is removed from xenstore in a transaction. Signed-off-by: Max Zhen --- tools/xenstore/xenstored_watch.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/xenstore/xenstored_watch.c b/tools/xenstore/xenstored_watch.c index 5fa8bbbe22..72927fa9c7 100644 --- a/tools/xenstore/xenstored_watch.c +++ b/tools/xenstore/xenstored_watch.c @@ -59,7 +59,16 @@ static void add_event(struct connection *conn, if (!check_event_node(name)) { /* Can this conn load node, or see that it doesn't exist? */ struct node *node = get_node(conn, name, XS_PERM_READ); - if (!node && errno != ENOENT) + /* + * XXX We allow EACCES here because otherwise a non-dom0 + * backend driver cannot watch for disappearance of a frontend + * xenstore directory. When the directory disappears, we + * revert to permissions of the parent directory for that path, + * which will typically disallow access for the backend. + * But this breaks device-channel teardown! + * Really we should fix this better... + */ + if (!node && errno != ENOENT && errno != EACCES) return; } -- 2.39.5