aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEwan Mellor <ewan@xensource.com>2006-12-18 00:00:57 +0000
committerEwan Mellor <ewan@xensource.com>2006-12-18 00:00:57 +0000
commit99ffd43bcdcae2f3b1ca0ad7327c267985026cfc (patch)
tree4d9592647eaf0d9dfd6a244889346270d36397db
parentc7272094f39e59c1a6c2d76488f16675e0906a8b (diff)
downloadxen-99ffd43bcdcae2f3b1ca0ad7327c267985026cfc.tar.gz
xen-99ffd43bcdcae2f3b1ca0ad7327c267985026cfc.tar.bz2
xen-99ffd43bcdcae2f3b1ca0ad7327c267985026cfc.zip
Write the xfb configuration details to the store, rather than storing them in
memory. This ensures that the VM can be rebooted after a xend restart. Signed-off-by: Ewan Mellor <ewan@xensource.com>
-rw-r--r--tools/python/xen/xend/server/vfbif.py30
1 files changed, 18 insertions, 12 deletions
diff --git a/tools/python/xen/xend/server/vfbif.py b/tools/python/xen/xend/server/vfbif.py
index 2161ff7331..d07cd2f9e8 100644
--- a/tools/python/xen/xend/server/vfbif.py
+++ b/tools/python/xen/xend/server/vfbif.py
@@ -13,6 +13,9 @@ def spawn_detached(path, args, env):
else:
os.waitpid(p, 0)
+CONFIG_ENTRIES = ['type', 'vncdisplay', 'vnclisten', 'vncpasswd', 'vncunused',
+ 'display', 'xauthority']
+
class VfbifController(DevController):
"""Virtual frame buffer controller. Handles all vfb devices for a domain.
Note that we only support a single vfb per domain at the moment.
@@ -20,24 +23,27 @@ class VfbifController(DevController):
def __init__(self, vm):
DevController.__init__(self, vm)
- self.config = {}
def getDeviceDetails(self, config):
"""@see DevController.getDeviceDetails"""
- devid = 0
- back = {}
- front = {}
- return (devid, back, front)
+
+ back = dict([(k, config[k]) for k in CONFIG_ENTRIES
+ if config.has_key(k)])
+
+ return (0, back, {})
+
def getDeviceConfiguration(self, devid):
- r = DevController.getDeviceConfiguration(self, devid)
- for (k,v) in self.config.iteritems():
- r[k] = v
- return r
-
+ result = DevController.getDeviceConfiguration(self, devid)
+
+ devinfo = self.readBackend(devid, *CONFIG_ENTRIES)
+ return dict([(CONFIG_ENTRIES[i], devinfo[i])
+ for i in range(len(CONFIG_ENTRIES))
+ if devinfo[i] is not None])
+
+
def createDevice(self, config):
DevController.createDevice(self, config)
- self.config = config
std_args = [ "--domid", "%d" % self.vm.getDomid(),
"--title", self.vm.getName() ]
t = config.get("type", None)
@@ -47,7 +53,7 @@ class VfbifController(DevController):
passwd = config["vncpasswd"]
else:
passwd = xen.xend.XendRoot.instance().get_vncpasswd_default()
- if not(passwd is None or passwd == ""):
+ if passwd:
self.vm.storeVm("vncpasswd", passwd)
log.debug("Stored a VNC password for vfb access")
else: