From: dinesh chandrasekaran Subject: RE: xenstore -- read UUID Date: Wed, 10 Sep 2008 05:54:56 +0530 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0186098278==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: derek.murray@cl.cam.ac.uk, xen developers community , xen users community List-Id: xen-devel@lists.xenproject.org --===============0186098278== Content-Type: multipart/alternative; boundary="_866517ab-45bf-41b2-893d-8e07ffefddb1_" --_866517ab-45bf-41b2-893d-8e07ffefddb1_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Derek=2C they were 2 seperate questions... sorry for the typos... How to access xenstore from Dom-0? -- which you said 'YES'... And How to access xenstore from hypervosor?=20 Yes.. as you said 'make xen' doesnt include /usr/include libraries and I di= d check that...=20 If the hypervisor has no knowledge about XenStore=2C Dom-0 must have the fu= ll control over the xenstore. I need to build a table with some fields one of which should never change d= uring a VMs lifetime. For example=2C if I chose the domain_id whose value is transient=2C If the = VM reboots=2C its domain_id changes. That is the reason why I opted for the UUID of a domain that persists over = time even after migration to another machine. The only way I could get a domain's UUID is through the xenstore and want t= o take away domain-0 from the picture=2C which according to you is almost impossible. anyway out? regards=2C Dinesh C > Date: Tue=2C 9 Sep 2008 21:37:57 +0100 > From: Derek.Murray@cl.cam.ac.uk > To: dinesh_chan8@hotmail.com > Subject: Re: [Xen-devel] xenstore -- read UUID > CC: xen-devel@lists.xensource.com=3B xen-users@lists.xensource.com >=20 > Hi Dinesh=2C >=20 > In what context are you trying to run this code? You say that you want > to read the UUID from Dom0=2C but xen/common/memory.c is part of the > hypervisor (and not Dom0). If you try to compile that code into > xen/common/memory.c=2C it will fail=2C because building the hypervisor > does not include the user-space headers (i.e. the contents of > /usr/include/). >=20 > The hypervisor has (almost) no knowledge about XenStore=2C and so it > would be very difficult to access XenStore from there. However=2C if you > want to access this information in Dom0=2C your code should work in a > user-space application. >=20 > Could you provide more details about what you are trying to do? >=20 > Regards=2C >=20 > Derek Murray. >=20 > On Tue=2C Sep 9=2C 2008 at 8:36 PM=2C dinesh chandrasekaran > wrote: > > Hi All=2C > > > > Im trying to read the UUID of a domain-U from domain-0 using the > > following code from inside say xen/common/memory.c. > > > > The include file is present both in /usr/include and > > tools/xenstore/xs.h > > > > #include > > static int get_domain_uuid(unsigned int domain_id) { > > struct xs_handle *xs=3B > > xs_transaction_t t=3B > > char *path=3B > > unsigned int *len=3B > > void *uuid=3B > > xs =3D xs_daemon_open()=3B > > if (xs =3D=3D NULL) > > return 1=3B > > path =3D xs_get_domain_path(xs=2C domain_id)=3B > > if (path =3D=3D NULL) > > return 1=3B > > strcat (path=2C '/uuid')=3B > > len =3D strlen(path) + 1=3B > > uuid =3D xs_read(xs=2C t=2C path=2C len)=3B > > printf('%lx \n'=2C (char) (*uuid))=3B > > xs_daemon_close(xs)=3B > > free(path)=3B > > return 0=3B > > } > > > > when compiled throws an error ( xs.h - no such file or directory). > > > > How to access xenstore and read the doamin UUID from dom-0 specifically= from > > inside xen/common/memory.c? > > > > regards=2C > > Dinesh C > > > > ________________________________ > > Voice your opinion on the burning issues of the day. Discuss=2C debate = with > > the world. Logon to message boards on MSN. Try it! > > _______________________________________________ > > Xen-devel mailing list > > Xen-devel@lists.xensource.com > > http://lists.xensource.com/xen-devel > > > > _________________________________________________________________ Searching for the best deals on travel? Visit MSN Travel. http://in.msn.com/coxandkings= --_866517ab-45bf-41b2-893d-8e07ffefddb1_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi Derek=2C

they were 2 seperate q= uestions... sorry for the typos...
How to access xenstore from Dom-0? --= which you said 'YES'...
And How to access xenstore from hypervosor? Yes.. as you said 'make xen' doesnt include /usr/include libraries and I d= id check that...

If the hypervisor has no knowledge about XenStore= =2C Dom-0 must have the full control over the xenstore.
I need to build = a table with some fields one of which should never change during a VMs life= time.
For example=2C if I chose the domain_id whose value is transient= =2C If the VM reboots=2C its domain_id changes.
That is the reason why I= opted for the UUID of a domain that persists over time even after migratio= n to another machine.
The only way I could get a domain's UUID is throug= h the xenstore and want to take away domain-0 from the picture=2C which
= according to you is almost impossible.

anyway out?

regards=2C=
Dinesh C

>=3B Date: Tue=2C 9 Sep 2008 21:37:57 +0100
>=3B= From: Derek.Murray@cl.cam.ac.uk
>=3B To: dinesh_chan8@hotmail.com
= >=3B Subject: Re: [Xen-devel] xenstore -- read UUID
>=3B CC: xen-dev= el@lists.xensource.com=3B xen-users@lists.xensource.com
>=3B
>= =3B Hi Dinesh=2C
>=3B
>=3B In what context are you trying to run= this code? You say that you want
>=3B to read the UUID from Dom0=2C b= ut xen/common/memory.c is part of the
>=3B hypervisor (and not Dom0). = If you try to compile that code into
>=3B xen/common/memory.c=2C it wi= ll fail=2C because building the hypervisor
>=3B does not include the u= ser-space headers (i.e. the contents of
>=3B /usr/include/).
>=3B=
>=3B The hypervisor has (almost) no knowledge about XenStore=2C and = so it
>=3B would be very difficult to access XenStore from there. Howe= ver=2C if you
>=3B want to access this information in Dom0=2C your cod= e should work in a
>=3B user-space application.
>=3B
>=3B C= ould you provide more details about what you are trying to do?
>=3B >=3B Regards=2C
>=3B
>=3B Derek Murray.
>=3B
>=3B= On Tue=2C Sep 9=2C 2008 at 8:36 PM=2C dinesh chandrasekaran
>=3B <= =3Bdinesh_chan8@hotmail.com>=3B wrote:
>=3B >=3B Hi All=2C
>= =3B >=3B
>=3B >=3B Im trying to read the UUID of a domain-U f= rom domain-0 using the
>=3B >=3B following code from inside say xen/= common/memory.c.
>=3B >=3B
>=3B >=3B The include file <=3Bx= s.h>=3B is present both in /usr/include and
>=3B >=3B tools/xensto= re/xs.h
>=3B >=3B
>=3B >=3B #include <=3Bxs.h>=3B
>= =3B >=3B static int get_domain_uuid(unsigned int domain_id) {
>=3B &= gt=3B struct xs_handle *xs=3B
>=3B >=3B xs_transacti= on_t t=3B
>=3B >=3B char *path=3B
>=3B >=3B u= nsigned int *len=3B
>=3B >=3B void *uuid=3B
>=3B >=3B= xs =3D xs_daemon_open()=3B
>=3B >=3B if (xs =3D=3D = NULL)
>=3B >=3B return 1=3B
>=3B >=3B = path =3D xs_get_domain_path(xs=2C domain_id)=3B
>=3B >=3B i= f (path =3D=3D NULL)
>=3B >=3B return 1=3B
>=3B= >=3B strcat (path=2C '/uuid')=3B
>=3B >=3B len = =3D strlen(path) + 1=3B
>=3B >=3B uuid =3D xs_read(xs=2C t= =2C path=2C len)=3B
>=3B >=3B printf('%lx \n'=2C (char) (*uu= id))=3B
>=3B >=3B xs_daemon_close(xs)=3B
>=3B >=3B = free(path)=3B
>=3B >=3B return 0=3B
>=3B >=3B }=
>=3B >=3B
>=3B >=3B when compiled throws an error ( xs.h - n= o such file or directory).
>=3B >=3B
>=3B >=3B How to access = xenstore and read the doamin UUID from dom-0 specifically from
>=3B &g= t=3B inside xen/common/memory.c?
>=3B >=3B
>=3B >=3B regards= =2C
>=3B >=3B Dinesh C
>=3B >=3B
>=3B >=3B ___________= _____________________
>=3B >=3B Voice your opinion on the burning is= sues of the day. Discuss=2C debate with
>=3B >=3B the world. Logon t= o message boards on MSN. Try it!
>=3B >=3B _________________________= ______________________
>=3B >=3B Xen-devel mailing list
>=3B &g= t=3B Xen-devel@lists.xensource.com
>=3B >=3B http://lists.xensource.= com/xen-devel
>=3B >=3B
>=3B >=3B


Watch useful= tips on recipes=2C fitness=2C yoga and fashion only on MSN videos. Try it! = --_866517ab-45bf-41b2-893d-8e07ffefddb1_-- --===============0186098278== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============0186098278==--