]> xenbits.xensource.com Git - xen.git/commitdiff
Fire watch for non-dom0 backend when frontend is removed from xenstore
authorKeir Fraser <keir@xensource.com>
Fri, 26 Oct 2007 10:48:58 +0000 (11:48 +0100)
committerKeir Fraser <keir@xensource.com>
Fri, 26 Oct 2007 10:48:58 +0000 (11:48 +0100)
in a transaction.
Signed-off-by: Max Zhen <max.zhen@sun.com>
tools/xenstore/xenstored_watch.c

index 5fa8bbbe226cf42ec2e14525b338767c8499323f..72927fa9c7ebd130a73d44b2c2157fa66786d3db 100644 (file)
@@ -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;
        }