ia64/xen-unstable

changeset 12762:98413fa7826c

[XEND] Re-add vtpm device support in XendConfig

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.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
author Alastair Tse <atse@xensource.com>
date Fri Dec 01 17:37:42 2006 +0000 (2006-12-01)
parents 4b577c1909a9
children 7dc0dd5cdb4d
files tools/python/scripts/xapi.py tools/python/xen/xend/XendConfig.py
line diff
     1.1 --- a/tools/python/scripts/xapi.py	Fri Dec 01 17:31:50 2006 +0000
     1.2 +++ b/tools/python/scripts/xapi.py	Fri Dec 01 17:37:42 2006 +0000
     1.3 @@ -446,8 +446,6 @@ def xapi_vtpm_create(*args):
     1.4      print "Has driver type '%s'" % driver
     1.5      vtpm_rec = execute(server.VTPM.get_record, session, vtpm_uuid)
     1.6      print "Has vtpm record '%s'" % vtpm_rec
     1.7 -    vm = execute(server.VTPM.get_VM, session, vtpm_uuid)
     1.8 -    print "Has VM '%s'" % vm
     1.9  
    1.10  
    1.11  #
     2.1 --- a/tools/python/xen/xend/XendConfig.py	Fri Dec 01 17:31:50 2006 +0000
     2.2 +++ b/tools/python/xen/xend/XendConfig.py	Fri Dec 01 17:37:42 2006 +0000
     2.3 @@ -945,7 +945,17 @@ class XendConfig(dict):
     2.4                  self['devices'][dev_uuid] = (dev_type, dev_info)
     2.5                  self['vbd_refs'].append(dev_uuid)                
     2.6                  return dev_uuid
     2.7 -            
     2.8 +
     2.9 +            elif dev_type in ('vtpm'):
    2.10 +                if cfg_xenapi.get('type'):
    2.11 +                    dev_info['type'] = cfg_xenapi.get('type')
    2.12 +
    2.13 +                dev_uuid = cfg_xenapi.get('uuid', uuid.createString())
    2.14 +                dev_info['uuid'] = dev_uuid
    2.15 +                self['devices'][dev_uuid] = (dev_type, dev_info)
    2.16 +                self['vtpm_refs'].append(dev_uuid)
    2.17 +                return dev_uuid
    2.18 +
    2.19          return ''
    2.20  
    2.21      def device_update(self, dev_uuid, cfg_sxp):