From: Ian Jackson Subject: [PATCH] Properly save/restore vnc/vfb configuration Date: Tue, 24 Mar 2009 18:10:42 +0000 Message-ID: <18889.8738.655242.864182@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Stefano Stabellini List-Id: xen-devel@lists.xenproject.org In 19284:0942BAA2A088 provision was made for running vnc and sdl simultaneously. However, arrangements for saving and restoring the new structure-configuration, and arrangements for allowing the new code to load old savefiles, were not made. This patch adds these facilities. Amongst other things, HVM VNC save/restore will now work properly again. Signed-off-by: Ian Jackson diff -r 0477f9061c8a tools/python/xen/xend/XendConfig.py --- a/tools/python/xen/xend/XendConfig.py Fri Mar 20 17:42:46 2009 +0000 +++ b/tools/python/xen/xend/XendConfig.py Tue Mar 24 18:07:38 2009 +0000 @@ -1410,6 +1410,21 @@ class XendConfig(dict): if dev_uuid not in target['console_refs']: target['console_refs'].append(dev_uuid) + # Cope with old-format save files which say under vfb + # (type vfb) rather than (vfb 1) + try: + vfb_type = dev_info['type'] + except KeyError: + vfb_type = None + log.debug("iwj dev_type=%s vfb type %s" % + (dev_type, `vfb_type`)) + + if vfb_type == 'vnc' or vfb_type == 'sdl': + dev_info[vfb_type] = 1 + del dev_info['type'] + log.debug("iwj dev_type=%s vfb setting dev_info['%s']" % + (dev_type, vfb_type)) + elif dev_type == 'console': if 'console_refs' not in target: target['console_refs'] = [] diff -r 0477f9061c8a tools/python/xen/xend/server/vfbif.py --- a/tools/python/xen/xend/server/vfbif.py Fri Mar 20 17:42:46 2009 +0000 +++ b/tools/python/xen/xend/server/vfbif.py Tue Mar 24 17:29:39 2009 +0000 @@ -6,7 +6,7 @@ import os import os CONFIG_ENTRIES = ['type', 'vncdisplay', 'vnclisten', 'vncpasswd', 'vncunused', - 'videoram', 'display', 'xauthority', 'keymap', + 'videoram', 'display', 'xauthority', 'keymap', 'vnc', 'sdl', 'uuid', 'location', 'protocol', 'opengl'] class VfbifController(DevController):