On 26/09/06 11:56 +0300, Liran Schour wrote:
"Fischer, Anna" <anna.fischer@xxxxxx> wrote on 25/09/2006 19:31:32:
One option to get the UUID is to read it from the Xenstore. The Xenstore
can be accessed in user space (using xenstore-read/write) and in kernel
space using the kernel API. The API is defined in tools/xenstore/xs.h.
All domains are indexed by their UUID in the Xenstore in the path /vm.
There're different ways to find the UUID. If you have the domain ID then
you can find the UUID under /local/domain/$DOMID/vm/$UUID.
You might want to have a look in the Xenstore reference of the XenWiki.
There's some sample code, too. Is that what you were looking for?
I need to get the UUID from kernel space. As I have noticed the kernel API
(xenbus_scanf) assumes you are already in /local/domain/0 and starts the
lookup from that point. I need to go back in the path to /local/domain/X I
don't know how to do this from kernel space.
I started to look at this issue with the intent of making each
domain's uuid and other info available in via sysfs, which means it
would also be available in kernel space.
However I concluded that it was too ugly and would run in to
previously expressed skepticism in the kernel community regarding xen
information in sysfs.
What I determined at the time (a couple of months ago) was that the
kernel needed an API to xenstore, via xenbus. The path would entail
going through xenbus to register for an event (creation of a new
domain), then exporting that information back to userspace through
sysfs. I just didn't make a lot of sense.
Any other approach, I beleive, would run in to similar issues, because
kernel space has no idea what its UUID is.
Mike D. Day
Virtualization Architect Sr. Technical Staff Member, IBM LTC
Cell: 919 412-3900 Office: 919 543-4283
AIM: ncmikeday Yahoo: ultra.runner
Xen-devel mailing list