ia64/xen-unstable

view tools/python/xen/xend/server/ConsoleController.py @ 13771:3cccf8e64296

[XEND] Merge VFB support for PV and HVM guests.

This patch merges the way VFB are represented inside Xend by making
HVM VNC consoles use the VFB as its configuration object.

It preserves the way options are specified through xm but will create
a new VFB device that is used by image.py to put vnc config into
qemu-dm's command line. The parsing is moved into image.py's
parseDeviceModel() rather than in configVNC().

Through the Xen API, you can create a 'console' of protocol 'rfb' and
end up with a VNC console, on both HVM and PV guests. The location of
the connecting port is stored in the location attribute of the console
object. This is updated on each XendDomainInfo.update() if it
changes.

Also fixes missing read of the vnclisten and HVM_boot from the
config when initialised via xm. Makes sure bootable attribute for VBD
is store as an int when making SXP config.

Signed-off-by: Alastair Tse <atse@xensource.com>
author Alastair Tse <atse@xensource.com>
date Wed Jan 31 13:20:36 2007 +0000 (2007-01-31)
parents fbe161b1af16
children 09d8b6eb3131
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 = ['location', '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
30 def migrate(self, deviceConfig, network, dst, step, domName):
31 return 0
33 def destroyDevice(self, devid, force):
34 DevController.destroyDevice(self, devid, True)