Skip to contentSkip to conversation

xenstore -- read UUID

DISCUSSION dinesh chandrasekaran 2 participants 2 messages Sep 11, 2008

lore
Share & tools
lore
#0 lore raw

Hi geoffrey,
the xen_domain_handle_t in the domain handle field is an unsigned char array of size 16.
Where could the UUID be accessed from?
or how would you relate the d->handle to the domain's uuid (where d is of type struct domain *d). is all the 16 entries in the d->handle clubbed together to get the domain's uuid?

thanks,
Dinesh C

Quoted 18 lines

Date: Wed, 10 Sep 2008 08:31:11 -0700
From: [email protected]
To: [email protected]
Subject: Re: [Xen-devel] xenstore -- read UUID
CC: [email protected]; [email protected]; [email protected]

Hi everyone,

Sorry for the late joining to this thread.

If you really want to gather a domain's uuid from within the hypervisor, it's actually possible to do without xenstore. A domain's uuid gets stored as a xen_domain_handle_t in the domain handle field (see xen/include/xen/sched.h and xen/commom/domctl.c). The uuid of a domain gets passed to xen on domain creation. The uuid can also be read from a privileged domain by issuing the XEN_DOMCTL_getdomaininfo hypercall.

Quoted 52 lines

But as Derek mentioned earlier, you can read the domain uuid from a guest via xenstore which is probably a better idea.

cheers,

geoffrey

Quoted 44 lines · Derek Murray

Hi Dinesh,

Quoted 2 lines · dinesh chandrasekaran

they were 2 seperate questions... sorry for the typos... How to access xenstore from Dom-0? -- which you said 'YES'...

Yes, this is certainly possible: your code should work (I haven't tested it) in Dom0 user-space. For another example, see tools/xenstore/xsls.c, which implements ls functionality for xenstore using the same interface.

Quoted 1 line

And How to access xenstore from hypervosor?

There is no code to do this in Xen at the moment.

Quoted 2 lines

If the hypervisor has no knowledge about XenStore, Dom-0 must have the full control over the xenstore.

Correct. XenStore is simply implemented as a user-space daemon (xenstored), running as root in Dom0.

Quoted 9 lines

I need to build a table with some fields one of which should never change during a VMs lifetime.
For example, if I chose the domain_id whose value is transient, If the VM reboots, 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 to take away domain-0 from the picture, which
according to you is almost impossible.

Instead of Dom0, you could possibly do this in a stubdomain. It is possible to access XenStore from a MiniOS-based domain.

Regards,

Derek Murray.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_________________________________________________________________
Search for videos of Bollywood, Hollywood, Mollywood and every other wood, only on Live.com
http://www.live.com/?scope=video&form=MICOAL

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 9 lines

Hi geoffrey,
the xen_domain_handle_t in the domain handle field is an
unsigned char array of size 16.
Where could the UUID be accessed from?
or how would you relate the d->handle to the domain's uuid (where d is of type struct domain *d).
is all the 16 entries in the d->handle clubbed together to get the domain's uuid?

Hi dinesh,

d->handle contains the domain uuid.

A uuid is a 16 byte number. Xen and libuuid store uuids as 16 byte char array. They both define typedefs (xen_domain_handle_t and uuid_t respectively) for a 16 byte char array.

If you want to generate a human readable version, you can use uuid_unparse to generate a 37 character C string from the uuid_t.

Hope this helps.

geoffrey