ia64/xen-unstable

annotate tools/python/xen/xend/server/ConsoleController.py @ 13678:fbe161b1af16

To avoid problems (hang) when doing migration, the Console Controller
needs to implement a (dummy) migrate method.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
author kaf24@localhost.localdomain
date Sun Jan 28 09:47:22 2007 +0000 (2007-01-28)
parents ba3ec84c9423
children 3cccf8e64296
rev   line source
atse@13642 1 from xen.xend.server.DevController import DevController
atse@13642 2 from xen.xend.XendLogging import log
atse@13642 3
atse@13642 4 from xen.xend.XendError import VmError
atse@13642 5
atse@13642 6 class ConsoleController(DevController):
atse@13642 7 """A dummy controller for us to represent serial and vnc
atse@13642 8 console devices with persistent UUIDs.
atse@13642 9 """
atse@13642 10
atse@13642 11 valid_cfg = ['uri', 'uuid', 'protocol']
atse@13642 12
atse@13642 13 def __init__(self, vm):
atse@13642 14 DevController.__init__(self, vm)
atse@13642 15 self.hotplug = False
atse@13642 16
atse@13642 17 def getDeviceDetails(self, config):
atse@13642 18 back = dict([(k, config[k]) for k in self.valid_cfg if k in config])
atse@13642 19 return (self.allocateDeviceID(), back, {})
atse@13642 20
atse@13642 21
atse@13642 22 def getDeviceConfiguration(self, devid):
atse@13642 23 result = DevController.getDeviceConfiguration(self, devid)
atse@13642 24 devinfo = self.readBackend(devid, *self.valid_cfg)
atse@13642 25 config = dict(zip(self.valid_cfg, devinfo))
atse@13642 26 config = dict([(key, val) for key, val in config.items()
atse@13642 27 if val != None])
atse@13642 28 return config
atse@13642 29
kaf24@13678 30 def migrate(self, deviceConfig, network, dst, step, domName):
kaf24@13678 31 return 0