ia64/xen-unstable

changeset 8294:3ab6a6c4b6ed

The attached patch uncouples the device id used inside XenD from the
instance number of the vTPM.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
author emellor@leeni.uk.xensource.com
date Thu Dec 08 18:19:24 2005 +0000 (2005-12-08)
parents cd434888abdc
children 8aac8746047b
files tools/python/xen/xend/server/tpmif.py
line diff
     1.1 --- a/tools/python/xen/xend/server/tpmif.py	Thu Dec 08 18:17:59 2005 +0000
     1.2 +++ b/tools/python/xen/xend/server/tpmif.py	Thu Dec 08 18:19:24 2005 +0000
     1.3 @@ -38,10 +38,14 @@ class TPMifController(DevController):
     1.4      def getDeviceDetails(self, config):
     1.5          """@see DevController.getDeviceDetails"""
     1.6  
     1.7 -        devid = int(sxp.child_value(config, 'pref_instance', '0'))
     1.8 -        log.info("The domain has a TPM with instance %d." % devid)
     1.9 +        devid = self.allocateDeviceID()
    1.10 +        inst = int(sxp.child_value(config, 'pref_instance', '-1'))
    1.11 +        if inst == -1:
    1.12 +            inst = int(sxp.child_value(config, 'instance' , '0'))
    1.13  
    1.14 -        back  = { 'pref_instance' : "%i" % devid }
    1.15 +        log.info("The domain has a TPM with instance %d and devid %d.",
    1.16 +                 inst, devid)
    1.17 +        back  = { 'pref_instance' : "%i" % inst }
    1.18          front = { 'handle' : "%i" % devid }
    1.19  
    1.20          return (devid, back, front)