All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <Ian.Campbell@citrix.com>
To: "Jiang, Yunhong" <yunhong.jiang@intel.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"gm281@cam.ac.uk" <gm281@cam.ac.uk>
Subject: Re: Why xs_domain_open() in fs_backend
Date: Wed, 13 Oct 2010 14:47:36 +0100	[thread overview]
Message-ID: <1286977656.2003.3346.camel@zakaz.uk.xensource.com> (raw)
In-Reply-To: <1286975935.2003.3310.camel@zakaz.uk.xensource.com>

On Wed, 2010-10-13 at 14:18 +0100, Ian Campbell wrote:
> On Wed, 2010-10-13 at 13:57 +0100, Ian Campbell wrote:
> > 
> > I don't know how useful it is generally but it can be used to shows
> > that "xenstore-watch -s x" (i.e. xs_daemon_open) does appear to be
> > broken. 
> 
> Actually this is backwards and I seem to be seeing the exact opposite to
> you. IOW for me:
> 
> "xenstore-watch x"	-> xs_domain_open()	-- works
> "xenstore-watch -s x"	-> xs_daemon_open()	-- does not work, XS_ERROR reply from daemon
> 
> Can you confirm which version fails for you?
> 
> It also seems to be specific to the C xenstored, the ocaml oxenstored
> works fine.
> 
> Lastly it seems to be a problem with relative paths only, absolute paths
> seem to be ok.

This appears to be deliberate. xenstore clients connecting via the
socket interface have no implicit /local/domain/<domid> home directory.
(see xenstored_core.c:canonicalize and its use from
xenstored_watch.c:do_watch) and therefore must use absolute paths. The
ocaml xenstored works around this by assuming that socket connections
originate in domain 0, which is a little dubious if oxenstored is
running in a stub domain but in that case there is no userspace and
hence no clients using the socket interface, so it is fine.

The only problem I see is that it uses whatever random errno happens to
be current in the error message.

Ian.

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1286977342 -3600
# Node ID 78f2c9b4d902fa04f7055012c63d6dd24e823da0
# Parent  9a5a576bcc8ae17f19c9f89b73a026a0acfb5cf1
xenstored: return EINVAL for attempt to watch invalid path

errno is essentially random at this point.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r 9a5a576bcc8a -r 78f2c9b4d902 tools/xenstore/xenstored_watch.c
--- a/tools/xenstore/xenstored_watch.c	Wed Oct 13 13:56:12 2010 +0100
+++ b/tools/xenstore/xenstored_watch.c	Wed Oct 13 14:42:22 2010 +0100
@@ -134,7 +134,7 @@ void do_watch(struct connection *conn, s
 		relative = !strstarts(vec[0], "/");
 		vec[0] = canonicalize(conn, vec[0]);
 		if (!is_valid_nodename(vec[0])) {
-			send_error(conn, errno);
+			send_error(conn, EINVAL);
 			return;
 		}
 	}

  reply	other threads:[~2010-10-13 13:47 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-13  7:19 Why xs_domain_open() in fs_backend Jiang, Yunhong
2010-10-13  8:47 ` Tim Deegan
2010-10-13  9:13   ` Jiang, Yunhong
2010-10-13  9:24     ` Tim Deegan
2010-10-13 10:30       ` Stefano Stabellini
2010-10-13 12:20         ` Jiang, Yunhong
2010-10-13 13:53     ` Ian Campbell
2010-10-13 13:59       ` Jiang, Yunhong
2010-10-13 12:57 ` Ian Campbell
2010-10-13 13:18   ` Ian Campbell
2010-10-13 13:47     ` Ian Campbell [this message]
2010-10-13 14:04       ` Jiang, Yunhong
2010-10-13 15:34         ` Ian Campbell
2010-10-15  2:29           ` Jiang, Yunhong
2010-10-15  6:49             ` Ian Campbell
2010-10-15  6:55               ` Jiang, Yunhong
2010-10-21 16:57       ` Ian Jackson
2010-10-21 17:15   ` Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1286977656.2003.3346.camel@zakaz.uk.xensource.com \
    --to=ian.campbell@citrix.com \
    --cc=gm281@cam.ac.uk \
    --cc=xen-devel@lists.xensource.com \
    --cc=yunhong.jiang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.