ia64/xen-unstable

changeset 13814:f84ba62ca615

Fix SDL option for HVM domains.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Thu Feb 01 15:44:00 2007 +0000 (2007-02-01)
parents 1fb0302683d3
children 14fc88872c84 138b7aa45ede
files tools/python/xen/xend/image.py
line diff
     1.1 --- a/tools/python/xen/xend/image.py	Thu Feb 01 15:32:16 2007 +0000
     1.2 +++ b/tools/python/xen/xend/image.py	Thu Feb 01 15:44:00 2007 +0000
     1.3 @@ -449,48 +449,50 @@ class HVMImageHandler(ImageHandler):
     1.4              return ret
     1.5  
     1.6          vnc_config = {}
     1.7 -        has_vfb = False
     1.8          has_vnc = int(vmConfig['image'].get('vnc', 0)) != 0
     1.9 +        has_sdl = int(vmConfig['image'].get('sdl', 0)) != 0
    1.10          for dev_uuid in vmConfig['console_refs']:
    1.11              dev_type, dev_info = vmConfig['devices'][dev_uuid]
    1.12              if dev_type == 'vfb':
    1.13                  vnc_config = dev_info.get('other_config', {})
    1.14 -                has_vfb = True
    1.15 +                has_vnc = True
    1.16                  break
    1.17  
    1.18 -        if not vnc_config:
    1.19 -            for key in ('vncunused', 'vnclisten', 'vncdisplay', 'vncpasswd'):
    1.20 -                if key in vmConfig['image']:
    1.21 -                    vnc_config[key] = vmConfig['image'][key]
    1.22 +        if has_vnc:
    1.23 +            if not vnc_config:
    1.24 +                for key in ('vncunused', 'vnclisten', 'vncdisplay',
    1.25 +                            'vncpasswd'):
    1.26 +                    if key in vmConfig['image']:
    1.27 +                        vnc_config[key] = vmConfig['image'][key]
    1.28  
    1.29 -        if not has_vfb and not has_vnc:
    1.30 -            ret.append('-nographic')
    1.31 -            return ret
    1.32 -
    1.33 -                    
    1.34 -        if not vnc_config.get('vncunused', 0) and \
    1.35 -               vnc_config.get('vncdisplay', 0):
    1.36 -            ret.append('-vnc')
    1.37 -            ret.append(str(vncdisplay))
    1.38 -        else:
    1.39 -            ret.append('-vncunused')
    1.40 +            if not vnc_config.get('vncunused', 0) and \
    1.41 +                   vnc_config.get('vncdisplay', 0):
    1.42 +                ret.append('-vnc')
    1.43 +                ret.append(str(vncdisplay))
    1.44 +            else:
    1.45 +                ret.append('-vncunused')
    1.46  
    1.47 -        vnclisten = vnc_config.get('vnclisten',
    1.48 -                                   xenopts().get_vnclisten_address())
    1.49 -        ret.append('-vnclisten')
    1.50 -        ret.append(str(vnclisten))
    1.51 -        
    1.52 -        # Store vncpassword in xenstore
    1.53 -        vncpasswd = vnc_config.get('vncpasswd')
    1.54 -        if not vncpasswd:
    1.55 -            vncpasswd = xenopts().get_vncpasswd_default()
    1.56 -                    
    1.57 -        if vncpasswd is None:
    1.58 -            raise VmError('vncpasswd is not setup in vmconfig or '
    1.59 -                          'xend-config.sxp')
    1.60 +            vnclisten = vnc_config.get('vnclisten',
    1.61 +                                       xenopts().get_vnclisten_address())
    1.62 +            ret.append('-vnclisten')
    1.63 +            ret.append(str(vnclisten))
    1.64 +
    1.65 +            # Store vncpassword in xenstore
    1.66 +            vncpasswd = vnc_config.get('vncpasswd')
    1.67 +            if not vncpasswd:
    1.68 +                vncpasswd = xenopts().get_vncpasswd_default()
    1.69  
    1.70 -        if vncpasswd != '':
    1.71 -            self.vm.storeVm('vncpasswd', vncpasswd)
    1.72 +            if vncpasswd is None:
    1.73 +                raise VmError('vncpasswd is not setup in vmconfig or '
    1.74 +                              'xend-config.sxp')
    1.75 +
    1.76 +            if vncpasswd != '':
    1.77 +                self.vm.storeVm('vncpasswd', vncpasswd)
    1.78 +        elif has_sdl:
    1.79 +            # SDL is default in QEMU.
    1.80 +            pass
    1.81 +        else:
    1.82 +            ret.append('-nographic')
    1.83  
    1.84          return ret
    1.85