From: emellor@leeni.uk.xensource.com Date: Tue, 23 May 2006 15:23:10 +0000 (+0100) Subject: Allow a guest to determine its VM UUID. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~16025^2~30 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e73effa056c01e832553273d9fd2634be341d6fa;p=xen.git Allow a guest to determine its VM UUID. Use xenstore-read $(xenstore-read vm)/uuid. Signed-off-by: Ewan Mellor --- diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index 8be996c5a2..e28f9914a1 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -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):