43 lines
1.5 KiB
Diff
43 lines
1.5 KiB
Diff
# HG changeset patch
|
|
# User Alastair Tse <atse@xensource.com>
|
|
# Date 1169779475 0
|
|
# Node ID ba3ec84c9423a4eb7f7a4c1de052f9e935d17891
|
|
# Parent 9d1d9877131de3aec3d56b277c03075d7f63f3a1
|
|
[XEND] Add missing ConsoleController.py
|
|
|
|
Signed-off-by: Alastair Tse <atse@xensource.com>
|
|
|
|
diff -r 9d1d9877131d -r ba3ec84c9423 tools/python/xen/xend/server/ConsoleController.py
|
|
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
|
+++ b/tools/python/xen/xend/server/ConsoleController.py Fri Jan 26 02:44:35 2007 +0000
|
|
@@ -0,0 +1,29 @@
|
|
+from xen.xend.server.DevController import DevController
|
|
+from xen.xend.XendLogging import log
|
|
+
|
|
+from xen.xend.XendError import VmError
|
|
+
|
|
+class ConsoleController(DevController):
|
|
+ """A dummy controller for us to represent serial and vnc
|
|
+ console devices with persistent UUIDs.
|
|
+ """
|
|
+
|
|
+ valid_cfg = ['uri', 'uuid', 'protocol']
|
|
+
|
|
+ def __init__(self, vm):
|
|
+ DevController.__init__(self, vm)
|
|
+ self.hotplug = False
|
|
+
|
|
+ def getDeviceDetails(self, config):
|
|
+ back = dict([(k, config[k]) for k in self.valid_cfg if k in config])
|
|
+ return (self.allocateDeviceID(), back, {})
|
|
+
|
|
+
|
|
+ def getDeviceConfiguration(self, devid):
|
|
+ result = DevController.getDeviceConfiguration(self, devid)
|
|
+ devinfo = self.readBackend(devid, *self.valid_cfg)
|
|
+ config = dict(zip(self.valid_cfg, devinfo))
|
|
+ config = dict([(key, val) for key, val in config.items()
|
|
+ if val != None])
|
|
+ return config
|
|
+
|