source: trunk/packages/xen-3.1/xen-3.1/tools/python/xen/xend/server/ConsoleController.py @ 34

Last change on this file since 34 was 34, checked in by hartmans, 18 years ago

Add xen and xen-common

File size: 1.1 KB
Line 
1from xen.xend.server.DevController import DevController
2from xen.xend.XendLogging import log
3
4from xen.xend.XendError import VmError
5
6class ConsoleController(DevController):
7    """A dummy controller for us to represent serial and vnc
8    console devices with persistent UUIDs.
9    """
10
11    valid_cfg = ['location', 'uuid', 'protocol']
12
13    def __init__(self, vm):
14        DevController.__init__(self, vm)
15        self.hotplug = False
16
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, {})
20
21
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
29
30    def migrate(self, deviceConfig, network, dst, step, domName):
31        return 0
32
33    def destroyDevice(self, devid, force):
34        DevController.destroyDevice(self, devid, True)
35       
Note: See TracBrowser for help on using the repository browser.