ia64/xen-unstable

changeset 9884:268e45409ecd

The features for a domain are more a property of the domain than the
image. Move them into the domain info so that the image is just the
pieces needed for booting (eg, kernel + initrd + args)

Signed-off-by: Jeremy Katz <katzj@redhat.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Apr 28 14:10:59 2006 +0100 (2006-04-28)
parents f06b6db6823d
children ef6216b43278
files tools/python/xen/xend/XendDomainInfo.py tools/python/xen/xend/image.py tools/python/xen/xm/create.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Fri Apr 28 14:09:35 2006 +0100
     1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Fri Apr 28 14:10:59 2006 +0100
     1.3 @@ -132,6 +132,7 @@ ROUNDTRIPPING_CONFIG_ENTRIES = [
     1.4      ('memory',     int),
     1.5      ('maxmem',     int),
     1.6      ('bootloader', str),
     1.7 +    ('features', str),
     1.8      ]
     1.9  
    1.10  ROUNDTRIPPING_CONFIG_ENTRIES += VM_CONFIG_PARAMS
    1.11 @@ -549,6 +550,7 @@ class XendDomainInfo:
    1.12              defaultInfo('on_poweroff',  lambda: "destroy")
    1.13              defaultInfo('on_reboot',    lambda: "restart")
    1.14              defaultInfo('on_crash',     lambda: "restart")
    1.15 +            defaultInfo('features',     lambda: "")
    1.16              defaultInfo('cpu',          lambda: None)
    1.17              defaultInfo('cpus',         lambda: [])
    1.18              defaultInfo('cpu_weight',   lambda: 1.0)
    1.19 @@ -775,6 +777,9 @@ class XendDomainInfo:
    1.20          """For use only by image.py and XendCheckpoint.py"""
    1.21          return self.console_port
    1.22  
    1.23 +    def getFeatures(self):
    1.24 +        """For use only by image.py."""
    1.25 +        return self.info['features']
    1.26  
    1.27      def getVCpuCount(self):
    1.28          return self.info['vcpus']
     2.1 --- a/tools/python/xen/xend/image.py	Fri Apr 28 14:09:35 2006 +0100
     2.2 +++ b/tools/python/xen/xend/image.py	Fri Apr 28 14:10:59 2006 +0100
     2.3 @@ -68,7 +68,6 @@ class ImageHandler:
     2.4          self.kernel = None
     2.5          self.ramdisk = None
     2.6          self.cmdline = None
     2.7 -        self.features = None
     2.8  
     2.9          self.configure(imageConfig, deviceConfig)
    2.10  
    2.11 @@ -90,7 +89,6 @@ class ImageHandler:
    2.12          if args:
    2.13              self.cmdline += " " + args
    2.14          self.ramdisk = get_cfg("ramdisk", '')
    2.15 -        self.features = get_cfg("features", '')
    2.16          
    2.17          self.vm.storeVm(("image/ostype", self.ostype),
    2.18                          ("image/kernel", self.kernel),
    2.19 @@ -177,7 +175,7 @@ class LinuxImageHandler(ImageHandler):
    2.20          log.debug("cmdline        = %s", self.cmdline)
    2.21          log.debug("ramdisk        = %s", self.ramdisk)
    2.22          log.debug("vcpus          = %d", self.vm.getVCpuCount())
    2.23 -        log.debug("features       = %s", self.features)
    2.24 +        log.debug("features       = %s", self.vm.getFeatures())
    2.25  
    2.26          return xc.linux_build(dom            = self.vm.getDomid(),
    2.27                                image          = self.kernel,
    2.28 @@ -185,7 +183,7 @@ class LinuxImageHandler(ImageHandler):
    2.29                                console_evtchn = console_evtchn,
    2.30                                cmdline        = self.cmdline,
    2.31                                ramdisk        = self.ramdisk,
    2.32 -                              features       = self.features)
    2.33 +                              features       = self.vm.getFeatures())
    2.34  
    2.35  class HVMImageHandler(ImageHandler):
    2.36  
     3.1 --- a/tools/python/xen/xm/create.py	Fri Apr 28 14:09:35 2006 +0100
     3.2 +++ b/tools/python/xen/xm/create.py	Fri Apr 28 14:10:59 2006 +0100
     3.3 @@ -456,8 +456,6 @@ def configure_image(vals):
     3.4          config_image.append(['root', cmdline_root])
     3.5      if vals.extra:
     3.6          config_image.append(['args', vals.extra])
     3.7 -    if vals.features:
     3.8 -        config_image.append(['features', vals.features])
     3.9  
    3.10      if vals.builder == 'hvm':
    3.11          configure_hvm(config_image, vals)
    3.12 @@ -638,7 +636,7 @@ def make_config(vals):
    3.13                  config.append([n, v])
    3.14  
    3.15      map(add_conf, ['name', 'memory', 'maxmem', 'restart', 'on_poweroff',
    3.16 -                   'on_reboot', 'on_crash', 'vcpus'])
    3.17 +                   'on_reboot', 'on_crash', 'vcpus', 'features'])
    3.18  
    3.19      if vals.uuid is not None:
    3.20          config.append(['uuid', vals.uuid])