aboutsummaryrefslogtreecommitdiffstats
path: root/tools/python
diff options
context:
space:
mode:
authorMatthew Fioravante <matthew.fioravante@jhuapl.edu>2012-11-19 12:59:48 +0000
committerMatthew Fioravante <matthew.fioravante@jhuapl.edu>2012-11-19 12:59:48 +0000
commitaaa9ddeec8ae6bb7d6f0d1a467ef283dd39c34f1 (patch)
tree39d23f23de649a8a5149c2f781b1acf76f562c8b /tools/python
parenta338016154a0163d7e82a355e87651db7903c1b2 (diff)
downloadxen-aaa9ddeec8ae6bb7d6f0d1a467ef283dd39c34f1.tar.gz
xen-aaa9ddeec8ae6bb7d6f0d1a467ef283dd39c34f1.tar.bz2
xen-aaa9ddeec8ae6bb7d6f0d1a467ef283dd39c34f1.zip
xend: Remove old vtpm support from xm
Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/python')
-rw-r--r--tools/python/README.XendConfig2
-rw-r--r--tools/python/README.sxpcfg4
-rw-r--r--tools/python/scripts/xapi.py20
-rw-r--r--tools/python/xen/xend/XendAPI.py128
-rw-r--r--tools/python/xen/xend/XendConfig.py19
-rw-r--r--tools/python/xen/xend/XendConstants.py8
-rw-r--r--tools/python/xen/xend/XendDevices.py4
-rw-r--r--tools/python/xen/xend/XendDomainInfo.py29
-rw-r--r--tools/python/xen/xend/XendError.py1
-rw-r--r--tools/python/xen/xend/XendOptions.py4
-rw-r--r--tools/python/xen/xend/server/tpmif.py141
-rw-r--r--tools/python/xen/xend/tests/xend-config.sxp2
-rw-r--r--tools/python/xen/xm/create.dtd4
-rw-r--r--tools/python/xen/xm/create.py69
-rw-r--r--tools/python/xen/xm/main.py37
-rw-r--r--tools/python/xen/xm/xenapi_create.py39
16 files changed, 4 insertions, 507 deletions
diff --git a/tools/python/README.XendConfig b/tools/python/README.XendConfig
index 9cc0eadaa6..338715b051 100644
--- a/tools/python/README.XendConfig
+++ b/tools/python/README.XendConfig
@@ -71,8 +71,6 @@ vbds !(devices.vbds)
- io_read_kbs
- io_write_kbs
-tpm_instance tpm.instance
-tpm_backend tpm.backend
bios_boot image.boot?
platform_std_VGA image.stdvga
platform_serial image.serial
diff --git a/tools/python/README.sxpcfg b/tools/python/README.sxpcfg
index 7a17fd1515..a4762fec97 100644
--- a/tools/python/README.sxpcfg
+++ b/tools/python/README.sxpcfg
@@ -105,10 +105,6 @@ io
- from
- to
-tpm
- - pref_instance
- - instance
-
pciquirk
- pci_ids
- pci_config_space_fields
diff --git a/tools/python/scripts/xapi.py b/tools/python/scripts/xapi.py
index 9530f4a151..099718722f 100644
--- a/tools/python/scripts/xapi.py
+++ b/tools/python/scripts/xapi.py
@@ -58,7 +58,6 @@ COMMANDS = {
'vdi-rename': ('<vdi_uuid> <new_name>', 'Rename VDI'),
'vdi-destroy': ('<vdi_uuid>', 'Delete VDI'),
'vif-create': ('<domname> <pycfg>', 'Create VIF attached to domname'),
- 'vtpm-create' : ('<domname> <pycfg>', 'Create VTPM attached to domname'),
'vm-create': ('<pycfg>', 'Create VM with python config'),
'vm-destroy': ('<domname>', 'Delete VM'),
@@ -284,22 +283,16 @@ def xapi_vm_list(args, async = False):
if is_long:
vbds = vm_info['VBDs']
vifs = vm_info['VIFs']
- vtpms = vm_info['VTPMs']
vif_infos = []
vbd_infos = []
- vtpm_infos = []
for vbd in vbds:
vbd_info = execute(server, 'VBD.get_record', (session, vbd))
vbd_infos.append(vbd_info)
for vif in vifs:
vif_info = execute(server, 'VIF.get_record', (session, vif))
vif_infos.append(vif_info)
- for vtpm in vtpms:
- vtpm_info = execute(server, 'VTPM.get_record', (session, vtpm))
- vtpm_infos.append(vtpm_info)
vm_info['VBDs'] = vbd_infos
vm_info['VIFs'] = vif_infos
- vm_info['VTPMs'] = vtpm_infos
pprint(vm_info)
else:
print VM_LIST_FORMAT % _stringify(vm_info)
@@ -661,19 +654,6 @@ def xapi_vdi_rename(args, async = False):
print 'Done.'
-
-def xapi_vtpm_create(args, async = False):
- server, session = connect()
- domname = args[0]
- cfg = _read_python_cfg(args[1])
-
- vm_uuid = resolve_vm(server, session, domname)
- cfg['VM'] = vm_uuid
- print "Creating vTPM with cfg = %s" % cfg
- vtpm_uuid = execute(server, 'VTPM.create', (session, cfg))
- print "Done. (%s)" % vtpm_uuid
-
-
def xapi_pif_list(args, async = False):
server, session = connect()
pif_uuids = execute(server, 'PIF.get_all', (session,))
diff --git a/tools/python/xen/xend/XendAPI.py b/tools/python/xen/xend/XendAPI.py
index 54eec31590..359a26b7da 100644
--- a/tools/python/xen/xend/XendAPI.py
+++ b/tools/python/xen/xend/XendAPI.py
@@ -377,17 +377,6 @@ def valid_vdi(func):
_check_ref(XendNode.instance().is_valid_vdi,
'VDI', func, *args, **kwargs)
-def valid_vtpm(func):
- """Decorator to verify if vtpm_ref is valid before calling method.
-
- @param func: function with params: (self, session, vtpm_ref, ...)
- @rtype: callable object
- """
- return lambda *args, **kwargs: \
- _check_ref(lambda r: XendDomain.instance().is_valid_dev('vtpm', r),
- 'VTPM', func, *args, **kwargs)
-
-
def valid_console(func):
"""Decorator to verify if console_ref is valid before calling method.
@@ -481,7 +470,6 @@ classes = {
'VIF' : valid_vif,
'VIF_metrics' : valid_vif_metrics,
'VDI' : valid_vdi,
- 'VTPM' : valid_vtpm,
'console' : valid_console,
'SR' : valid_sr,
'task' : valid_task,
@@ -1293,7 +1281,6 @@ class XendAPI(object):
'consoles',
'VIFs',
'VBDs',
- 'VTPMs',
'DPCIs',
'DSCSIs',
'DSCSI_HBAs',
@@ -1436,10 +1423,6 @@ class XendAPI(object):
dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
return xen_api_success(dom.get_vbds())
- def VM_get_VTPMs(self, session, vm_ref):
- dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
- return xen_api_success(dom.get_vtpms())
-
def VM_get_consoles(self, session, vm_ref):
dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
return xen_api_success(dom.get_consoles())
@@ -1851,7 +1834,6 @@ class XendAPI(object):
'consoles': xeninfo.get_consoles(),
'VIFs': xeninfo.get_vifs(),
'VBDs': xeninfo.get_vbds(),
- 'VTPMs': xeninfo.get_vtpms(),
'DPCIs': xeninfo.get_dpcis(),
'DSCSIs': xeninfo.get_dscsis(),
'DSCSI_HBAs': xeninfo.get_dscsi_HBAs(),
@@ -2537,116 +2519,6 @@ class XendAPI(object):
vdi = XendNode.instance().get_vdi_by_uuid(vdi_ref)
return xen_api_success(vdi.get_security_label())
- # Xen API: Class VTPM
- # ----------------------------------------------------------------
-
- VTPM_attr_rw = ['other_config']
- VTPM_attr_ro = ['VM',
- 'backend',
- 'runtime_properties' ]
-
- VTPM_attr_inst = VTPM_attr_rw
-
- VTPM_methods = [('destroy', None)]
- VTPM_funcs = [('create', 'VTPM')]
-
- def VTPM_get_other_config(self, session, vtpm_ref):
- xendom = XendDomain.instance()
- return xen_api_success(xendom.get_dev_property_by_uuid('vtpm',
- vtpm_ref,
- 'other_config'))
-
- def VTPM_set_other_config(self, session, vtpm_ref, other_config):
- xendom = XendDomain.instance()
- xendom.set_dev_property_by_uuid('vtpm',
- vtpm_ref,
- 'other_config',
- other_config)
- return xen_api_success_void()
-
- # object methods
- def VTPM_get_record(self, session, vtpm_ref):
- xendom = XendDomain.instance()
- vm = xendom.get_vm_with_dev_uuid('vtpm', vtpm_ref)
- if not vm:
- return xen_api_error(['HANDLE_INVALID', 'VTPM', vtpm_ref])
- cfg = vm.get_dev_xenapi_config('vtpm', vtpm_ref)
- if not cfg:
- return xen_api_error(['HANDLE_INVALID', 'VTPM', vtpm_ref])
- valid_vtpm_keys = self.VTPM_attr_ro + self.VTPM_attr_rw + \
- self.Base_attr_ro + self.Base_attr_rw
- return_cfg = {}
- for k in cfg.keys():
- if k in valid_vtpm_keys:
- return_cfg[k] = cfg[k]
-
- return xen_api_success(return_cfg)
-
- # Class Functions
- def VTPM_get_backend(self, session, vtpm_ref):
- xendom = XendDomain.instance()
- vm = xendom.get_vm_with_dev_uuid('vtpm', vtpm_ref)
- if not vm:
- return xen_api_error(['HANDLE_INVALID', 'VTPM', vtpm_ref])
- cfg = vm.get_dev_xenapi_config('vtpm', vtpm_ref)
- if not cfg:
- return xen_api_error(['HANDLE_INVALID', 'VTPM', vtpm_ref])
- if not cfg.has_key('backend'):
- return xen_api_error(['INTERNAL_ERROR', 'VTPM backend not set'])
- return xen_api_success(cfg['backend'])
-
- def VTPM_get_VM(self, session, vtpm_ref):
- xendom = XendDomain.instance()
- return xen_api_success(xendom.get_dev_property_by_uuid('vtpm',
- vtpm_ref, 'VM'))
-
- def VTPM_destroy(self, session, vtpm_ref):
- xendom = XendDomain.instance()
- dom = xendom.get_vm_with_dev_uuid('vtpm', vtpm_ref)
- if dom:
- if dom.state != XEN_API_VM_POWER_STATE_HALTED:
- vm_ref = dom.get_dev_property('vtpm', vtpm_ref, 'VM')
- return xen_api_error(['VM_BAD_POWER_STATE', vm_ref,
- XendDomain.POWER_STATE_NAMES[XEN_API_VM_POWER_STATE_HALTED],
- XendDomain.POWER_STATE_NAMES[dom.state]])
- from xen.xend.server import tpmif
- tpmif.destroy_vtpmstate(dom.getName())
- return xen_api_success_void()
- else:
- return xen_api_error(['HANDLE_INVALID', 'VTPM', vtpm_ref])
-
- # class methods
- def VTPM_create(self, session, vtpm_struct):
- xendom = XendDomain.instance()
- if xendom.is_valid_vm(vtpm_struct['VM']):
- dom = xendom.get_vm_by_uuid(vtpm_struct['VM'])
- try:
- vtpm_ref = dom.create_vtpm(vtpm_struct)
- xendom.managed_config_save(dom)
- return xen_api_success(vtpm_ref)
- except XendError, exn:
- return xen_api_error(['INTERNAL_ERROR', str(exn)])
- else:
- return xen_api_error(['HANDLE_INVALID', 'VM', vtpm_struct['VM']])
-
- def VTPM_get_all(self, session):
- xendom = XendDomain.instance()
- vtpms = [d.get_vtpms() for d in XendDomain.instance().list('all')]
- vtpms = reduce(lambda x, y: x + y, vtpms)
- return xen_api_success(vtpms)
-
- def VTPM_get_runtime_properties(self, _, vtpm_ref):
- xendom = XendDomain.instance()
- dominfo = xendom.get_vm_with_dev_uuid('vtpm', vtpm_ref)
- device = dominfo.get_dev_config_by_uuid('vtpm', vtpm_ref)
-
- try:
- device_sxps = dominfo.getDeviceSxprs('vtpm')
- device_dict = dict(device_sxps[0][1])
- return xen_api_success(device_dict)
- except:
- return xen_api_success({})
-
# Xen API: Class console
# ----------------------------------------------------------------
diff --git a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py
index 9c47e560e3..497a5f4b11 100644
--- a/tools/python/xen/xend/XendConfig.py
+++ b/tools/python/xen/xend/XendConfig.py
@@ -417,7 +417,6 @@ class XendConfig(dict):
'console_refs': [],
'vif_refs': [],
'vbd_refs': [],
- 'vtpm_refs': [],
'other_config': {},
'platform': {},
'target': 0,
@@ -937,7 +936,6 @@ class XendConfig(dict):
self['console_refs'] = cfg.get('console_refs', [])
self['vif_refs'] = cfg.get('vif_refs', [])
self['vbd_refs'] = cfg.get('vbd_refs', [])
- self['vtpm_refs'] = cfg.get('vtpm_refs', [])
# coalesce hvm vnc frame buffer with vfb config
if self.is_hvm() and int(self['platform'].get('vnc', 0)) != 0:
@@ -1488,7 +1486,7 @@ class XendConfig(dict):
# store dev references by uuid for certain device types
target['devices'][dev_uuid] = (dev_type, dev_info)
- if dev_type in ('vif', 'vbd', 'vtpm'):
+ if dev_type in ('vif', 'vbd'):
param = '%s_refs' % dev_type
if param not in target:
target[param] = []
@@ -1630,18 +1628,6 @@ class XendConfig(dict):
target['devices'][dev_uuid] = (dev_type, dev_info)
target['vbd_refs'].append(dev_uuid)
- elif dev_type == 'vtpm':
- if cfg_xenapi.get('type'):
- dev_info['type'] = cfg_xenapi.get('type')
-
- dev_uuid = cfg_xenapi.get('uuid', None)
- if not dev_uuid:
- dev_uuid = uuid.createString()
- dev_info['uuid'] = dev_uuid
- dev_info['other_config'] = cfg_xenapi.get('other_config', {})
- target['devices'][dev_uuid] = (dev_type, dev_info)
- target['vtpm_refs'].append(dev_uuid)
-
elif dev_type == 'console':
dev_uuid = cfg_xenapi.get('uuid', None)
if not dev_uuid:
@@ -2078,8 +2064,7 @@ class XendConfig(dict):
result.extend(target.get('console_refs', []) +
target.get('vbd_refs', []) +
- target.get('vif_refs', []) +
- target.get('vtpm_refs', []))
+ target.get('vif_refs', []))
result.extend([u for u in target['devices'].keys() if u not in result])
return result
diff --git a/tools/python/xen/xend/XendConstants.py b/tools/python/xen/xend/XendConstants.py
index c41b0fae54..bc1c400422 100644
--- a/tools/python/xen/xend/XendConstants.py
+++ b/tools/python/xen/xend/XendConstants.py
@@ -115,7 +115,7 @@ TRIGGER_TYPE = {
}
#
-# Device migration stages (eg. XendDomainInfo, XendCheckpoint, server.tpmif)
+# Device migration stages (eg. XendDomainInfo, XendCheckpoint)
#
DEV_MIGRATE_TEST = 0
@@ -124,12 +124,6 @@ DEV_MIGRATE_STEP2 = 2
DEV_MIGRATE_STEP3 = 3
#
-# VTPM-related constants
-#
-
-VTPM_DELETE_SCRIPT = auxbin.scripts_dir() + '/vtpm-delete'
-
-#
# Xenstore Constants
#
diff --git a/tools/python/xen/xend/XendDevices.py b/tools/python/xen/xend/XendDevices.py
index e4585e1836..bef4d8a11a 100644
--- a/tools/python/xen/xend/XendDevices.py
+++ b/tools/python/xen/xend/XendDevices.py
@@ -19,7 +19,7 @@
# A collection of DevControllers
#
-from xen.xend.server import blkif, netif, tpmif, pciif, iopif, irqif, vfbif, vscsiif, netif2, vusbif
+from xen.xend.server import blkif, netif, pciif, iopif, irqif, vfbif, vscsiif, netif2, vusbif
from xen.xend.server.BlktapController import BlktapController, Blktap2Controller
from xen.xend.server.ConsoleController import ConsoleController
@@ -38,7 +38,6 @@ class XendDevices:
'vbd': blkif.BlkifController,
'vif': netif.NetifController,
'vif2': netif2.NetifController2,
- 'vtpm': tpmif.TPMifController,
'pci': pciif.PciController,
'ioports': iopif.IOPortsController,
'irq': irqif.IRQController,
@@ -82,6 +81,5 @@ class XendDevices:
@type domain: XendDomainInfo
"""
from xen.xend.XendLogging import log
- tpmif.destroy_vtpmstate(domain.info.get('vtpm_refs'))
destroy_device_state = classmethod(destroy_device_state)
diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py
index 456e325923..e9d3e7e612 100644
--- a/tools/python/xen/xend/XendDomainInfo.py
+++ b/tools/python/xen/xend/XendDomainInfo.py
@@ -3908,12 +3908,6 @@ class XendDomainInfo:
else:
config['mode'] = 'RW'
- if dev_class == 'vtpm':
- if not config.has_key('type'):
- config['type'] = 'paravirtualised' # TODO
- if not config.has_key('backend'):
- config['backend'] = "00000000-0000-0000-0000-000000000000"
-
return config
def get_dev_property(self, dev_class, dev_uuid, field):
@@ -3945,9 +3939,6 @@ class XendDomainInfo:
def get_vbds(self):
return self.info.get('vbd_refs', [])
- def get_vtpms(self):
- return self.info.get('vtpm_refs', [])
-
def get_dpcis(self):
return XendDPCI.get_by_VM(self.info.get('uuid'))
@@ -4046,23 +4037,6 @@ class XendDomainInfo:
return dev_uuid
- def create_vtpm(self, xenapi_vtpm):
- """Create a VTPM device from the passed struct in Xen API format.
-
- @return: uuid of the device
- @rtype: string
- """
-
- if self._stateGet() not in (DOM_STATE_HALTED,):
- raise VmError("Can only add vTPM to a halted domain.")
- if self.get_vtpms() != []:
- raise VmError('Domain already has a vTPM.')
- dev_uuid = self.info.device_add('vtpm', cfg_xenapi = xenapi_vtpm)
- if not dev_uuid:
- raise XendError('Failed to create device')
-
- return dev_uuid
-
def create_console(self, xenapi_console):
""" Create a console device from a Xen API struct.
@@ -4301,9 +4275,6 @@ class XendDomainInfo:
def destroy_vif(self, dev_uuid):
self.destroy_device_by_uuid('vif', dev_uuid)
- def destroy_vtpm(self, dev_uuid):
- self.destroy_device_by_uuid('vtpm', dev_uuid)
-
def destroy_dpci(self, dev_uuid):
dpci = XendAPIStore.get(dev_uuid, 'DPCI')
diff --git a/tools/python/xen/xend/XendError.py b/tools/python/xen/xend/XendError.py
index 3be0651cf4..d7ec42daf3 100644
--- a/tools/python/xen/xend/XendError.py
+++ b/tools/python/xen/xend/XendError.py
@@ -246,7 +246,6 @@ XEND_ERROR_UNSUPPORTED = ('EUNSUPPORTED', 'Method Unsupported')
XEND_ERROR_VM_INVALID = ('EVMINVALID', 'VM Invalid')
XEND_ERROR_VBD_INVALID = ('EVBDINVALID', 'VBD Invalid')
XEND_ERROR_VIF_INVALID = ('EVIFINVALID', 'VIF Invalid')
-XEND_ERROR_VTPM_INVALID = ('EVTPMINVALID', 'VTPM Invalid')
XEND_ERROR_VDI_INVALID = ('EVDIINVALID', 'VDI Invalid')
XEND_ERROR_SR_INVALID = ('ESRINVALID', 'SR Invalid')
XEND_ERROR_XSPOLICY_INVALID = ('EXSPOLICYINVALID', 'XS Invalid')
diff --git a/tools/python/xen/xend/XendOptions.py b/tools/python/xen/xend/XendOptions.py
index 01287f7263..e2651e328e 100644
--- a/tools/python/xen/xend/XendOptions.py
+++ b/tools/python/xen/xend/XendOptions.py
@@ -349,10 +349,6 @@ class XendOptions:
else:
return None
- def get_external_migration_tool(self):
- """@return the name of the tool to handle virtual TPM migration."""
- return self.get_config_string('external-migration-tool', self.external_migration_tool_default)
-
def get_enable_dump(self):
return self.get_config_bool('enable-dump', 'no')
diff --git a/tools/python/xen/xend/server/tpmif.py b/tools/python/xen/xend/server/tpmif.py
deleted file mode 100644
index 23a10e9483..0000000000
--- a/tools/python/xen/xend/server/tpmif.py
+++ /dev/null
@@ -1,141 +0,0 @@
-#============================================================================
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of version 2.1 of the GNU Lesser General Public
-# License as published by the Free Software Foundation.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#============================================================================
-# Copyright (C) 2004 Mike Wray <mike.wray@hp.com>
-# Copyright (C) 2005 IBM Corporation
-# Author: Stefan Berger, stefanb@us.ibm.com
-# Copyright (C) 2005 XenSource Ltd
-#============================================================================
-
-"""Support for virtual TPM interfaces."""
-
-from xen.xend import XendOptions
-from xen.xend.XendLogging import log
-from xen.xend.XendError import XendError
-from xen.xend.XendConstants import DEV_MIGRATE_TEST, VTPM_DELETE_SCRIPT
-from xen.xend.server.DevController import DevController
-
-import os
-import re
-
-xoptions = XendOptions.instance()
-
-def destroy_vtpmstate(uuids):
- if os.path.exists(VTPM_DELETE_SCRIPT):
- for uuid in uuids:
- os.system(VTPM_DELETE_SCRIPT + " " + uuid)
-
-class TPMifController(DevController):
- """TPM interface controller. Handles all TPM devices for a domain.
- """
-
- def __init__(self, vm):
- DevController.__init__(self, vm)
-
-
- def getDeviceDetails(self, config):
- """@see DevController.getDeviceDetails"""
-
- devid = self.allocateDeviceID()
- inst = int(config.get('pref_instance', -1))
- if inst == -1:
- inst = int(config.get('instance', 0))
-
- typ = config.get('type')
- uuid = config.get('uuid')
-
- log.info("The domain has a TPM with pref. instance %d and devid %d.",
- inst, devid)
- back = { 'pref_instance' : "%i" % inst,
- 'resume' : "%s" % (self.vm.getResume()) }
- if typ:
- back['type'] = typ
- if uuid:
- back['uuid'] = uuid
-
- data = self.vm.info['devices'].get(uuid)
- if data:
- other = data[1].get('other_config')
- if type(other) == dict:
- for key, item in other.items():
- back['oc_' + key] = item
-
- front = { 'handle' : "%i" % devid }
-
- return (devid, back, front)
-
- def getDeviceConfiguration(self, devid, transaction = None):
- """Returns the configuration of a device"""
- result = DevController.getDeviceConfiguration(self, devid, transaction)
-
- (instance, uuid, type) = \
- self.readBackend(devid, 'instance',
- 'uuid',
- 'type')
-
- if instance:
- result['instance'] = instance
- if uuid:
- result['uuid'] = uuid
- if type:
- result['type'] = type
-
- if uuid:
- data = self.vm.info['devices'].get(uuid)
- if data:
- other = data[1].get('other_config')
- if other:
- result['other_config'] = other
-
- return result
-
- def migrate(self, deviceConfig, network, dst, step, domName):
- """@see DevContoller.migrate"""
- if network:
- tool = xoptions.get_external_migration_tool()
- if tool != '':
- log.info("Request to network-migrate device to %s. step=%d.",
- dst, step)
-
- if step == DEV_MIGRATE_TEST:
- """Assuming for now that everything is ok and migration
- with the given tool can proceed.
- """
- return 0
- else:
- fd = os.popen("%s -type vtpm -step %d -host %s -domname %s" %
- (tool, step, dst, domName),
- 'r')
- for line in fd.readlines():
- mo = re.search('Error', line)
- if mo:
- raise XendError("vtpm: Fatal error in migration step %d: %s" %
- (step, line))
- return 0
- else:
- log.debug("External migration tool not in configuration.")
- return -1
- return 0
-
- def recover_migrate(self, deviceConfig, network, dst, step, domName):
- """@see DevContoller.recover_migrate"""
- if network:
- tool = xoptions.get_external_migration_tool()
- if tool != '':
- log.info("Request to recover network-migrated device. last good step=%d.",
- step)
- fd = os.popen("%s -type vtpm -step %d -host %s -domname %s -recover" %
- (tool, step, dst, domName),
- 'r')
- return 0
diff --git a/tools/python/xen/xend/tests/xend-config.sxp b/tools/python/xen/xend/tests/xend-config.sxp
index 079302881e..9f26e3419b 100644
--- a/tools/python/xen/xend/tests/xend-config.sxp
+++ b/tools/python/xen/xend/tests/xend-config.sxp
@@ -127,5 +127,3 @@
# Whether to enable core-dumps when domains crash.
#(enable-dump no)
-# The tool used for initiating virtual TPM migration
-#(external-migration-tool '')
diff --git a/tools/python/xen/xm/create.dtd b/tools/python/xen/xm/create.dtd
index bc8d314119..c91ea9096a 100644
--- a/tools/python/xen/xm/create.dtd
+++ b/tools/python/xen/xm/create.dtd
@@ -38,7 +38,6 @@
memory,
vbd*,
vif*,
- vtpm*,
pci*,
vscsi*,
console*,
@@ -82,9 +81,6 @@
network CDATA #IMPLIED
security_label CDATA #IMPLIED>
-<!ELEMENT vtpm (name*)>
-<!ATTLIST vtpm backend CDATA #REQUIRED>
-
<!ELEMENT pci (pci_opt*)>
<!ATTLIST pci domain CDATA #REQUIRED
bus CDATA #REQUIRED
diff --git a/tools/python/xen/xm/create.py b/tools/python/xen/xm/create.py
index 7bad910941..22841aa8d3 100644
--- a/tools/python/xen/xm/create.py
+++ b/tools/python/xen/xm/create.py
@@ -324,10 +324,6 @@ gopts.var('netif', val='no|yes',
fn=set_bool, default=0,
use="Make the domain a network interface backend.")
-gopts.var('tpmif', val='no|yes',
- fn=append_value, default=0,
- use="Make the domain a TPM interface backend.")
-
gopts.var('disk', val='phy:DEV,VDEV,MODE[,DOM]',
fn=append_value, default=[],
use="""Add a disk device to a domain. The physical device is DEV,
@@ -419,20 +415,6 @@ gopts.var('vif2', val="front_mac=MAC,back_mac=MAC,backend=DOM,pdev=PDEV,max_bypa
and backend MAC addresses. Randomly generated
addresses will be used if either address is missing.""")
-gopts.var('vtpm', val="instance=INSTANCE,backend=DOM,type=TYPE",
- fn=append_value, default=[],
- use="""Add a TPM interface. On the backend side use the given
- instance as virtual TPM instance. The given number is merely the
- preferred instance number. The hotplug script will determine
- which instance number will actually be assigned to the domain.
- The associtation between virtual machine and the TPM instance
- number can be found in /etc/xen/vtpm.db. Use the backend in the
- given domain.
- The type parameter can be used to select a specific driver type
- that the VM can use. To prevent a fully virtualized domain (HVM)
- from being able to access an emulated device model, you may specify
- 'paravirtualized' here.""")
-
gopts.var('access_control', val="policy=POLICY,label=LABEL",
fn=append_value, default=[],
use="""Add a security label and the security policy reference that defines it.
@@ -997,37 +979,6 @@ def configure_mem_prot(config_image, vals):
"""
config_image.append(['s3_integrity', vals.s3_integrity])
-def configure_vtpm(config_devs, vals):
- """Create the config for virtual TPM interfaces.
- """
- vtpm = vals.vtpm
- if len(vtpm) > 0:
- d = vtpm[0]
- instance = d.get('instance')
- uuid = d.get('uuid')
- if instance == "VTPMD":
- instance = "0"
- else:
- if instance != None:
- try:
- if int(instance) == 0:
- err('VM config error: vTPM instance must not be 0.')
- except ValueError:
- err('Vm config error: could not parse instance number.')
- backend = d.get('backend')
- typ = d.get('type')
- config_vtpm = ['vtpm']
- if instance:
- config_vtpm.append(['pref_instance', instance])
- if backend:
- config_vtpm.append(['backend', backend])
- if typ:
- config_vtpm.append(['type', typ])
- if uuid:
- config_vtpm.append(['uuid', uuid])
- config_devs.append(['device', config_vtpm])
-
-
def configure_vifs(config_devs, vals):
"""Create the config for virtual network interfaces.
"""
@@ -1160,8 +1111,6 @@ def make_config(vals):
config.append(['backend', ['blkif']])
if vals.netif:
config.append(['backend', ['netif']])
- if vals.tpmif:
- config.append(['backend', ['tpmif']])
if vals.localtime:
config.append(['localtime', vals.localtime])
if vals.oos:
@@ -1193,7 +1142,6 @@ def make_config(vals):
configure_ioports(config_devs, vals)
configure_irq(config_devs, vals)
configure_vifs(config_devs, vals)
- configure_vtpm(config_devs, vals)
configure_vfbs(config_devs, vals)
configure_security(config, vals)
config += config_devs
@@ -1307,22 +1255,6 @@ def preprocess_irq(vals):
irq.append(d)
vals.irq = irq
-def preprocess_vtpm(vals):
- if not vals.vtpm: return
- vtpms = []
- for vtpm in vals.vtpm:
- d = {}
- a = vtpm.split(',')
- for b in a:
- (k, v) = b.strip().split('=', 1)
- k = k.strip()
- v = v.strip()
- if k not in ['backend', 'instance', 'uuid']:
- err('Invalid vtpm specifier: ' + vtpm)
- d[k] = v
- vtpms.append(d)
- vals.vtpm = vtpms
-
def preprocess_access_control(vals):
if not vals.access_control:
return
@@ -1401,7 +1333,6 @@ def preprocess(vals):
preprocess_ip(vals)
preprocess_irq(vals)
preprocess_nfs(vals)
- preprocess_vtpm(vals)
preprocess_access_control(vals)
preprocess_cpuid(vals, 'cpuid')
preprocess_cpuid(vals, 'cpuid_check')
diff --git a/tools/python/xen/xm/main.py b/tools/python/xen/xm/main.py
index 948d3ce570..429c573c59 100644
--- a/tools/python/xen/xm/main.py
+++ b/tools/python/xen/xm/main.py
@@ -204,7 +204,6 @@ SUBCOMMAND_HELP = {
'vnet-create' : ('<ConfigFile>','Create a vnet from ConfigFile.'),
'vnet-delete' : ('<VnetId>', 'Delete a Vnet.'),
'vnet-list' : ('[-l|--long]', 'List Vnets.'),
- 'vtpm-list' : ('<Domain> [--long]', 'List virtual TPM devices.'),
'pci-attach' : ('[-o|--options=<opt>] <Domain> <domain:bus:slot.func> [virtual slot]',
'Insert a new pass-through pci device.'),
'pci-detach' : ('<Domain> <domain:bus:slot.func>',
@@ -469,7 +468,6 @@ device_commands = [
"network2-attach",
"network2-detach",
"network2-list",
- "vtpm-list",
"pci-attach",
"pci-detach",
"pci-list",
@@ -2392,39 +2390,6 @@ def xm_block_list(args):
"%(be-path)-30s "
% ni)
-def xm_vtpm_list(args):
- (use_long, params) = arg_check_for_resource_list(args, "vtpm-list")
-
- dom = params[0]
-
- if serverType == SERVER_XEN_API:
- vtpm_refs = server.xenapi.VM.get_VTPMs(get_single_vm(dom))
- vtpm_properties = \
- map(server.xenapi.VTPM.get_runtime_properties, vtpm_refs)
- devs = map(lambda (handle, properties): [handle, map2sxp(properties)],
- zip(range(len(vtpm_properties)), vtpm_properties))
- else:
- devs = server.xend.domain.getDeviceSxprs(dom, 'vtpm')
-
- if use_long:
- map(PrettyPrint.prettyprint, devs)
- else:
- hdr = 0
- for x in devs:
- if hdr == 0:
- print 'Idx BE handle state evt-ch ring-ref BE-path'
- hdr = 1
- ni = parse_dev_info(x[1])
- ni['idx'] = int(x[0])
- print ("%(idx)-3d "
- "%(backend-id)-3d "
- "%(handle)-3d "
- "%(state)-3d "
- "%(event-ch)-3d "
- "%(ring-ref)-5d "
- "%(be-path)-30s "
- % ni)
-
def attached_pci_dict_bin(dom):
devs = []
if serverType == SERVER_XEN_API:
@@ -3854,8 +3819,6 @@ commands = {
"vnet-list": xm_vnet_list,
"vnet-create": xm_vnet_create,
"vnet-delete": xm_vnet_delete,
- # vtpm
- "vtpm-list": xm_vtpm_list,
#pci
"pci-attach": xm_pci_attach,
"pci-detach": xm_pci_detach,
diff --git a/tools/python/xen/xm/xenapi_create.py b/tools/python/xen/xm/xenapi_create.py
index 3d526d8c7c..346ff204d8 100644
--- a/tools/python/xen/xm/xenapi_create.py
+++ b/tools/python/xen/xm/xenapi_create.py
@@ -375,12 +375,6 @@ class xenapi_create:
self.create_vifs(vm_ref, vifs, networks)
- # Now create vtpms
-
- vtpms = vm.getElementsByTagName("vtpm")
-
- self.create_vtpms(vm_ref, vtpms)
-
# Now create consoles
consoles = vm.getElementsByTagName("console")
@@ -488,21 +482,6 @@ class xenapi_create:
self._network_refs = server.xenapi.network.get_all()
return self._network_refs.pop(0)
- def create_vtpms(self, vm_ref, vtpms):
- if len(vtpms) > 1:
- vtpms = [ vtpms[0] ]
- log(DEBUG, "create_vtpms")
- return map(lambda vtpm: self.create_vtpm(vm_ref, vtpm), vtpms)
-
- def create_vtpm(self, vm_ref, vtpm):
- vtpm_record = {
- "VM":
- vm_ref,
- "backend":
- vtpm.attributes["backend"].value
- }
- return server.xenapi.VTPM.create(vtpm_record)
-
def create_consoles(self, vm_ref, consoles):
log(DEBUG, "create_consoles")
return map(lambda console: self.create_console(vm_ref, console),
@@ -633,9 +612,6 @@ class sxp2xml:
vifs_sxp = map(lambda x: x[1], [device for device in devices
if device[1][0] == "vif"])
- vtpms_sxp = map(lambda x: x[1], [device for device in devices
- if device[1][0] == "vtpm"])
-
vfbs_sxp = map(lambda x: x[1], [device for device in devices
if device[1][0] == "vfb"])
@@ -780,12 +756,6 @@ class sxp2xml:
map(vm.appendChild, vifs)
- # And now the vTPMs
-
- vtpms = map(lambda vtpm: self.extract_vtpm(vtpm, document), vtpms_sxp)
-
- map(vm.appendChild, vtpms)
-
# And now the pcis
pcis = self.extract_pcis(pcis_sxp, document)
@@ -923,15 +893,6 @@ class sxp2xml:
return vif
- def extract_vtpm(self, vtpm_sxp, document):
-
- vtpm = document.createElement("vtpm")
-
- vtpm.attributes["backend"] \
- = get_child_by_name(vtpm_sxp, "backend", "0")
-
- return vtpm
-
def extract_vfb(self, vfb_sxp, document):
vfb = document.createElement("console")