Skip to contentSkip to conversation

XenD vTPM device id change

PATCH Applied Stefan Berger 2 participants 2 messages Dec 8, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 XenD vTPM device id change

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

xen-unstable.hg/tools/python/xen/xend/server/tpmif.py +8 -4
Index: 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)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel