From: Ian Campbell Subject: Re: xenstore root node change Date: Thu, 16 Dec 2010 14:48:58 +0000 Message-ID: <1292510938.32368.8107.camel@zakaz.uk.xensource.com> References: <20101216140225.GA28320@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20101216140225.GA28320@aepfle.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Olaf Hering Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Thu, 2010-12-16 at 14:02 +0000, Olaf Hering wrote: > On Wed, Dec 15, Olaf Hering wrote: > > > Current xen-unstable does not have backend/vbd/1/768/params for some > > It seems the root handling in xenstore-read has changed, it does not > operate in node /local/domain/0 anymore. > > In 4.0, a 'xenstore-read name' returns 'Domain-0', but in xen-unstable > it gives an error now: 'xenstore-read: couldn't read path name'. > > Using the absolute path 'xenstore-read /local/domain/0/name' works. > > Was this change intentional? If so, the hotplug scripts need an update. I don't think this was deliberate. Perhaps this is another unintended/unpredicted consequence of the recent switch to using xs_open instead of xs_{domain,daemon}_open? I didn't see the issue when running oxenstored but having switched to the C xenstored I can now reproduce. I think the difference is that xenstored does not apply the /local/domain/ working directory for connections over the socket while oxenstored does (I think the oxenstored behaviour is correct here). The switch to xs_open interface means that xenstore-read now prefers the socket interface over the domain interface. The following seems like the best fix right now. 8<----------------------- # HG changeset patch # User Ian Campbell # Date 1292510898 0 # Node ID 6ff0b7e76762b5ca359fbf0549211bb0c6b09100 # Parent 08f63aec7fa7078c19b0b92ab5dbda867427eebf xenstore: set implicit path for socket connections For now assume all such connections come from domain 0. Failure to do this breaks various scripts which assume that they operate relative to the domains "home directory". This matches the behaviour of the ocaml xenstored. Signed-off-by: Ian Campbell diff -r 08f63aec7fa7 -r 6ff0b7e76762 tools/xenstore/xenstored_domain.c --- a/tools/xenstore/xenstored_domain.c Thu Dec 16 14:31:05 2010 +0000 +++ b/tools/xenstore/xenstored_domain.c Thu Dec 16 14:48:18 2010 +0000 @@ -547,7 +547,7 @@ const char *get_implicit_path(const stru const char *get_implicit_path(const struct connection *conn) { if (!conn->domain) - return NULL; + return "/local/domain/0"; return conn->domain->path; }