ia64/xen-unstable

changeset 12836:f7cff5d296bf

[XEND] Fix configureBootloader to work with HTTP/SEXP.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
author Alastair Tse <atse@xensource.com>
date Thu Dec 07 11:41:38 2006 +0000 (2006-12-07)
parents e8a74ac80167
children aab2b3f739d2
files tools/python/xen/xend/XendConfig.py tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/xen/xend/XendConfig.py	Thu Dec 07 11:12:05 2006 +0000
     1.2 +++ b/tools/python/xen/xend/XendConfig.py	Thu Dec 07 11:41:38 2006 +0000
     1.3 @@ -680,6 +680,7 @@ class XendConfig(dict):
     1.4                  else:
     1.5                      self[sxp_arg] = val
     1.6  
     1.7 +        _set_cfg_if_exists('bootloader')
     1.8          _set_cfg_if_exists('shadow_memory')
     1.9          _set_cfg_if_exists('security')
    1.10          _set_cfg_if_exists('features')
     2.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Thu Dec 07 11:12:05 2006 +0000
     2.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Thu Dec 07 11:41:38 2006 +0000
     2.3 @@ -1326,7 +1326,7 @@ class XendDomainInfo:
     2.4  
     2.5          # if we have a boot loader but no image, then we need to set things
     2.6          # up by running the boot loader non-interactively
     2.7 -        if self.info.get('bootloader') and self.info.get('image'):
     2.8 +        if self.info.get('bootloader'):
     2.9              self._configureBootloader()
    2.10  
    2.11          if not self._infoIsSet('image'):
    2.12 @@ -1532,11 +1532,17 @@ class XendDomainInfo:
    2.13          if not self.info.get('bootloader'):
    2.14              return
    2.15          blcfg = None
    2.16 +
    2.17          # FIXME: this assumes that we want to use the first disk device
    2.18 -        for devuuid, (devtype, devinfo) in self.info.all_devices_sxpr():
    2.19 +        for (devtype, devinfo) in self.info.all_devices_sxpr():
    2.20              if not devtype or not devinfo or devtype not in ('vbd', 'tap'):
    2.21                  continue
    2.22 -            disk = devinfo.get('uname')
    2.23 +            disk = None
    2.24 +            for param in devinfo:
    2.25 +                if param[0] == 'uname':
    2.26 +                    disk = param[1]
    2.27 +                    break
    2.28 +
    2.29              if disk is None:
    2.30                  continue
    2.31              fn = blkdev_uname_to_file(disk)