ia64/xen-unstable

view tools/python/xen/xend/server/ConsoleController.py @ 13642:ba3ec84c9423

[XEND] Add missing ConsoleController.py

Signed-off-by: Alastair Tse <atse@xensource.com>
author Alastair Tse <atse@xensource.com>
date Fri Jan 26 02:44:35 2007 +0000 (2007-01-26)
parents
children fbe161b1af16
line source
1 from xen.xend.server.DevController import DevController
2 from xen.xend.XendLogging import log
4 from xen.xend.XendError import VmError
6 class ConsoleController(DevController):
7 """A dummy controller for us to represent serial and vnc
8 console devices with persistent UUIDs.
9 """
11 valid_cfg = ['uri', 'uuid', 'protocol']
13 def __init__(self, vm):
14 DevController.__init__(self, vm)
15 self.hotplug = False
17 def getDeviceDetails(self, config):
18 back = dict([(k, config[k]) for k in self.valid_cfg if k in config])
19 return (self.allocateDeviceID(), back, {})
22 def getDeviceConfiguration(self, devid):
23 result = DevController.getDeviceConfiguration(self, devid)
24 devinfo = self.readBackend(devid, *self.valid_cfg)
25 config = dict(zip(self.valid_cfg, devinfo))
26 config = dict([(key, val) for key, val in config.items()
27 if val != None])
28 return config