From: Stefan Berger Subject: [PATCH][TPM] XenD vTPM device id change Date: Thu, 08 Dec 2005 12:09:35 -0500 Message-ID: <1134061776.3335.20.camel@regensburg.watson.ibm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-iGrA0gATiDr0UFEMwAYV" 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: Xen dev mailing list List-Id: xen-devel@lists.xenproject.org --=-iGrA0gATiDr0UFEMwAYV Content-Type: text/plain Content-Transfer-Encoding: 7bit The attached patch uncouples the device id used inside XenD from the instance number of the vTPM. Signed-off-by: Stefan Berger --=-iGrA0gATiDr0UFEMwAYV Content-Disposition: attachment; filename=xend-vtpm-devid.diff Content-Type: text/x-patch; name=xend-vtpm-devid.diff; charset=UTF-8 Content-Transfer-Encoding: 7bit Index: root/xen-unstable.hg/tools/python/xen/xend/server/tpmif.py =================================================================== --- root.orig/xen-unstable.hg/tools/python/xen/xend/server/tpmif.py +++ root/xen-unstable.hg/tools/python/xen/xend/server/tpmif.py @@ -38,10 +38,14 @@ class TPMifController(DevController): def getDeviceDetails(self, config): """@see DevController.getDeviceDetails""" - devid = int(sxp.child_value(config, 'pref_instance', '0')) - log.info("The domain has a TPM with instance %d." % devid) - - back = { 'pref_instance' : "%i" % devid } + devid = self.allocateDeviceID() + inst = int(sxp.child_value(config, 'pref_instance', '-1')) + if inst == -1: + inst = int(sxp.child_value(config, 'instance' , '0')) + + log.info("The domain has a TPM with instance %d and devid %d.", + inst, devid) + back = { 'pref_instance' : "%i" % inst } front = { 'handle' : "%i" % devid } return (devid, back, front) --=-iGrA0gATiDr0UFEMwAYV 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 --=-iGrA0gATiDr0UFEMwAYV--