Skip to contentSkip to conversation

Re-add removed vtpm device handling code

PATCH In review Stefan Berger 2 participants 2 messages Dec 1, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Re-add removed vtpm device handling code

This patch re-adds a recently removed vTPM device handling code. I am also removing that one code part in the test script that does not work.

xen-unstable.hg/tools/python/xen/xend/XendConfig.py +11 -1
Index: root/xen-unstable.hg/tools/python/xen/xend/XendConfig.py
===================================================================
@@ -901,7 +901,17 @@ class XendConfig(dict):
                 self['devices'][dev_uuid] = (dev_type, dev_info)
                 self['vbd_refs'].append(dev_uuid)                
                 return dev_uuid
-            
+
+            elif dev_type in ('vtpm'):
+                if cfg_xenapi.get('type'):
+                    dev_info['type'] = cfg_xenapi.get('type')
+
+                dev_uuid = cfg_xenapi.get('uuid', uuid.createString())
+                dev_info['uuid'] = dev_uuid
+                self['devices'][dev_uuid] = (dev_type, dev_info)
+                self['vtpm_refs'].append(dev_uuid)
+                return dev_uuid
+
         return ''
 
     def device_update(self, dev_uuid, cfg_sxp):
xen-unstable.hg/tools/python/scripts/xapi.py +0 -2
Index: root/xen-unstable.hg/tools/python/scripts/xapi.py
===================================================================
@@ -446,8 +446,6 @@ def xapi_vtpm_create(*args):
     print "Has driver type '%s'" % driver
     vtpm_rec = execute(server.VTPM.get_record, session, vtpm_uuid)
     print "Has vtpm record '%s'" % vtpm_rec
-    vm = execute(server.VTPM.get_VM, session, vtpm_uuid)
-    print "Has VM '%s'" % vm
 
 
 #

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

#1 lore raw

Sorry, it probably got lost when I merged my work with the current xen-unstable. I've applied this patch to the tree.

Cheers,

Alastair

Quoted 10 lines · Stefan Berger

This patch re-adds a recently removed vTPM device handling code. I am also removing that one code part in the test script that does not work.

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