It appears that if an hvm guest has /proc/xen/xenbus, the xenstore-* tools can be made to work inside this guest. For example, inside an hvm guest which (according to "xm list" in domain0) has a domid of 2, I can do: # xenstore-ls /local/domain/2 and it works fine, whereas: # xenstore-ls /local/domain/0 fails properly with "Permission denied". So I can use xenstore-read and xenstore-write inside the guest but I need to know "my" domid to do so. Is there any way from inside the guest to determine its domid? Alternately, is there any syntax for the xenstore tools that allows me to refer to "self"? By using xenstore-exists repeatedly marching through the numerals, I can figure it out, but is there a better way? Thanks, Dan ==================================Thanks... for the memory I really could use more / My throughput's on the floor The balloon is flat / My swap disk's fat / I've OOM's in store Overcommitted so much (with apologies to the late great Bob Hope) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
I think xenstore accesses in a domU have a ''current working directory'' of /local/domain/<domid>/. What happens if you try accesses without an initial / in the path? -- Keir On 21/5/08 21:03, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:> It appears that if an hvm guest has /proc/xen/xenbus, the > xenstore-* tools can be made to work inside this guest. > For example, inside an hvm guest which (according to > "xm list" in domain0) has a domid of 2, I can do: > > # xenstore-ls /local/domain/2 > > and it works fine, whereas: > > # xenstore-ls /local/domain/0 > > fails properly with "Permission denied". > > So I can use xenstore-read and xenstore-write inside the > guest but I need to know "my" domid to do so. > > Is there any way from inside the guest to determine > its domid? Alternately, is there any syntax for the > xenstore tools that allows me to refer to "self"? > > By using xenstore-exists repeatedly marching through the > numerals, I can figure it out, but is there a better > way? > > Thanks, > Dan > > ==================================> Thanks... for the memory > I really could use more / My throughput''s on the floor > The balloon is flat / My swap disk''s fat / I''ve OOM''s in store > Overcommitted so much > (with apologies to the late great Bob Hope) > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser writes ("Re: [Xen-devel] xenstore and "my domid" on hvm guest"):> I think xenstore accesses in a domU have a ''current working directory'' of > /local/domain/<domid>/. What happens if you try accesses without an initial > / in the path?Yes, exactly. This is covered in docs/misc/xenstore.txt: Values commonly included in payloads include: <path> Specifies a path in the hierarchical key structure. If <path> starts with a / it simply represents that path. <path> is allowed not to start with /, in which case the caller must be a domain (rather than connected via a socket) and the path is taken to be relative to /local/domain/<domid> (eg, `x/y'' sent by domain 3 would mean `/local/domain/3/x/y''). Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Thu, May 22, 2008 at 10:37:00AM +0100, Ian Jackson wrote:> Keir Fraser writes ("Re: [Xen-devel] xenstore and "my domid" on hvm guest"): > > I think xenstore accesses in a domU have a ''current working directory'' of > > /local/domain/<domid>/. What happens if you try accesses without an initial > > / in the path? > > Yes, exactly. This is covered in docs/misc/xenstore.txt:Which would work great if the tools understood: xenstore-ls . but unfortunately they don''t, so you have to guess the names of the top-level directories regards john _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 22/5/08 12:40, "John Levon" <levon@movementarian.org> wrote:>>> I think xenstore accesses in a domU have a ''current working directory'' of >>> /local/domain/<domid>/. What happens if you try accesses without an initial >>> / in the path? >> >> Yes, exactly. This is covered in docs/misc/xenstore.txt: > > Which would work great if the tools understood: > > xenstore-ls . > > but unfortunately they don''t, so you have to guess the names of the > top-level directoriesThat''s quite a separate issue and could be quite easily fixed. E.g., by supporting the special single-character directory path ''.'', if anyone cared sufficiently about this limitation. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Dan Magenheimer
2008-May-22 15:01 UTC
RE: [Xen-devel] xenstore and "my domid" on hvm guest
Thanks much. Exactly what I was looking for! Dan> -----Original Message----- > From: Ian Jackson [mailto:Ian.Jackson@eu.citrix.com] > Sent: Thursday, May 22, 2008 3:37 AM > To: Keir Fraser > Cc: dan.magenheimer@oracle.com; Xen-Devel (E-mail) > Subject: Re: [Xen-devel] xenstore and "my domid" on hvm guest > > > Keir Fraser writes ("Re: [Xen-devel] xenstore and "my domid" > on hvm guest"): > > I think xenstore accesses in a domU have a ''current working > directory'' of > > /local/domain/<domid>/. What happens if you try accesses > without an initial > > / in the path? > > Yes, exactly. This is covered in docs/misc/xenstore.txt: > > Values commonly included in payloads include: > > <path> > Specifies a path in the hierarchical key structure. > If <path> starts with a / it simply represents that path. > > <path> is allowed not to start with /, in which case the > caller must be a domain (rather than connected via a socket) > and the path is taken to be relative to /local/domain/<domid> > (eg, `x/y'' sent by domain 3 would mean `/local/domain/3/x/y''). > > Ian. >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel