Mailing List Archive

Allow a guest to determine its VM UUID.
# HG changeset patch
# User emellor@leeni.uk.xensource.com
# Node ID 187180382772582f075d0e0f9da23843e0c9e2dd
# Parent d809359ab32d3915f075b8417536d6890ab28ded
Allow a guest to determine its VM UUID.

Use xenstore-read $(xenstore-read vm)/uuid.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
---
tools/python/xen/xend/XendDomainInfo.py | 10 ++++++++++
1 files changed, 10 insertions(+)

diff -r d809359ab32d -r 187180382772 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py Tue May 23 16:17:28 2006 +0100
+++ b/tools/python/xen/xend/XendDomainInfo.py Tue May 23 16:23:10 2006 +0100
@@ -701,6 +701,16 @@ class XendDomainInfo:
log.debug("Storing VM details: %s", to_store)

self.writeVm(to_store)
+ self.setVmPermissions()
+
+
+ def setVmPermissions(self):
+ """Allow the guest domain to read its UUID. We don't allow it to
+ access any other entry, for security."""
+ xstransact.SetPermissions('%s/uuid' % self.vmpath,
+ { 'dom' : self.domid,
+ 'read' : True,
+ 'write' : False })


def storeDomDetails(self):

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog