1 | from xen.xend.server.DevController import DevController |
---|
2 | from xen.xend.XendLogging import log |
---|
3 | |
---|
4 | from xen.xend.XendError import VmError |
---|
5 | |
---|
6 | class 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 | |
---|