ia64/xen-unstable

changeset 17030:17020f4eb0aa

xend: Better support for legacy HVM config with hvmloader configured
via the 'kernel' config option:
1. Look for any string containing 'hvmloader'.
2. The 'kernel' option must be scrubbed to avoid taking
PV-kernel-loading paths during later guest setup.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Feb 11 14:42:52 2008 +0000 (2008-02-11)
parents bab9e298450a
children 209512f6d89c
files tools/python/xen/xend/XendConfig.py tools/python/xen/xend/image.py
line diff
     1.1 --- a/tools/python/xen/xend/XendConfig.py	Mon Feb 11 10:57:17 2008 +0000
     1.2 +++ b/tools/python/xen/xend/XendConfig.py	Mon Feb 11 14:42:52 2008 +0000
     1.3 @@ -406,15 +406,13 @@ class XendConfig(dict):
     1.4  
     1.5          if self.is_hvm():
     1.6              if 'loader' not in self['platform']:
     1.7 -                log.debug("No loader present")
     1.8 -                # Old configs may have hvmloder set as PV_kernel param,
     1.9 -                # so lets migrate them....
    1.10 -                if self['PV_kernel'] == "/usr/lib/xen/boot/hvmloader":
    1.11 +                # Old configs may have hvmloader set as PV_kernel param
    1.12 +                if self.has_key('PV_kernel') and re.search('hvmloader', self['PV_kernel']):
    1.13                      self['platform']['loader'] = self['PV_kernel']
    1.14 -                    log.debug("Loader copied from kernel %s" % str(self['platform']['loader']))
    1.15 +                    self['PV_kernel'] = ''
    1.16                  else:
    1.17                      self['platform']['loader'] = "/usr/lib/xen/boot/hvmloader"
    1.18 -                    log.debug("Loader %s" % str(self['platform']['loader']))
    1.19 +                log.debug("Loader is %s" % str(self['platform']['loader']))
    1.20  
    1.21              # Compatibility hack, can go away soon.
    1.22              if 'soundhw' not in self['platform'] and \
     2.1 --- a/tools/python/xen/xend/image.py	Mon Feb 11 10:57:17 2008 +0000
     2.2 +++ b/tools/python/xen/xend/image.py	Mon Feb 11 14:42:52 2008 +0000
     2.3 @@ -455,7 +455,7 @@ class HVMImageHandler(ImageHandler):
     2.4          ret = ImageHandler.parseDeviceModelArgs(self, vmConfig)
     2.5          ret = ret + ['-vcpus', str(self.vm.getVCpuCount())]
     2.6  
     2.7 -        if self.kernel and self.kernel != "/usr/lib/xen/boot/hvmloader":
     2.8 +        if self.kernel:
     2.9              log.debug("kernel         = %s", self.kernel)
    2.10              ret = ret + ['-kernel', self.kernel]
    2.11          if self.ramdisk: