ia64/xen-unstable

changeset 16255:62426339d644

Fire watch for non-dom0 backend when frontend is removed from xenstore
in a transaction.
Signed-off-by: Max Zhen <max.zhen@sun.com>
author Keir Fraser <keir@xensource.com>
date Fri Oct 26 11:48:58 2007 +0100 (2007-10-26)
parents 3fe75ef9ca93
children 537b8edb1efa
files tools/xenstore/xenstored_watch.c
line diff
     1.1 --- a/tools/xenstore/xenstored_watch.c	Fri Oct 26 11:40:10 2007 +0100
     1.2 +++ b/tools/xenstore/xenstored_watch.c	Fri Oct 26 11:48:58 2007 +0100
     1.3 @@ -59,7 +59,16 @@ static void add_event(struct connection 
     1.4  	if (!check_event_node(name)) {
     1.5  		/* Can this conn load node, or see that it doesn't exist? */
     1.6  		struct node *node = get_node(conn, name, XS_PERM_READ);
     1.7 -		if (!node && errno != ENOENT)
     1.8 +		/*
     1.9 +		 * XXX We allow EACCES here because otherwise a non-dom0
    1.10 +		 * backend driver cannot watch for disappearance of a frontend
    1.11 +		 * xenstore directory. When the directory disappears, we
    1.12 +		 * revert to permissions of the parent directory for that path,
    1.13 +		 * which will typically disallow access for the backend.
    1.14 +		 * But this breaks device-channel teardown!
    1.15 +		 * Really we should fix this better...
    1.16 +		 */
    1.17 +		if (!node && errno != ENOENT && errno != EACCES)
    1.18  			return;
    1.19  	}
    1.20