ia64/xen-unstable

changeset 12723:6cbe0449dc85

[XEND] More fixes for HVM device configuration parsing

Removed duplicated acpi option, added missing stdvga option. Do not
output empty configurations in image sxp. Remove bug with vcpus
passing in device model.

Signed-off-by: Alastair Tse <atse@xensource.com>
author Alastair Tse <atse@xensource.com>
date Fri Dec 01 11:07:22 2006 +0000 (2006-12-01)
parents c032103da101
children aedeaa926893
files tools/python/xen/xend/XendConfig.py tools/python/xen/xend/image.py
line diff
     1.1 --- a/tools/python/xen/xend/XendConfig.py	Fri Dec 01 10:47:57 2006 +0000
     1.2 +++ b/tools/python/xen/xend/XendConfig.py	Fri Dec 01 11:07:22 2006 +0000
     1.3 @@ -185,7 +185,6 @@ LEGACY_IMAGE_HVM_CFG = [
     1.4      ('vncconsole', int),
     1.5      ('pae', int),
     1.6      ('apic', int),
     1.7 -    ('acpi', int),
     1.8  ]
     1.9  
    1.10  LEGACY_IMAGE_HVM_DEVICES_CFG = [
    1.11 @@ -196,7 +195,8 @@ LEGACY_IMAGE_HVM_DEVICES_CFG = [
    1.12      ('isa', str),
    1.13      ('keymap', str),    
    1.14      ('localtime', str),    
    1.15 -    ('serial', str),    
    1.16 +    ('serial', str),
    1.17 +    ('stdvga', int),
    1.18      ('soundhw', str),
    1.19      ('usb', str),
    1.20      ('usbdevice', str),    
    1.21 @@ -987,12 +987,12 @@ class XendConfig(dict):
    1.22  
    1.23          if 'hvm' in self['image']:
    1.24              for arg, conv in LEGACY_IMAGE_HVM_CFG:
    1.25 -                if self['image']['hvm'].has_key(arg):
    1.26 +                if self['image']['hvm'].get(arg):
    1.27                      image.append([arg, self['image']['hvm'][arg]])
    1.28  
    1.29          if 'hvm' in self['image'] and 'devices' in self['image']['hvm']:
    1.30              for arg, conv in LEGACY_IMAGE_HVM_DEVICES_CFG:
    1.31 -                if self['image']['hvm']['devices'].has_key(arg):
    1.32 +                if self['image']['hvm']['devices'].get(arg):
    1.33                      image.append([arg,
    1.34                                    self['image']['hvm']['devices'][arg]])
    1.35  
     2.1 --- a/tools/python/xen/xend/image.py	Fri Dec 01 10:47:57 2006 +0000
     2.2 +++ b/tools/python/xen/xend/image.py	Fri Dec 01 11:07:22 2006 +0000
     2.3 @@ -270,8 +270,9 @@ class HVMImageHandler(ImageHandler):
     2.4          self.dmargs += self.configVNC(imageConfig)
     2.5  
     2.6          self.pae  = imageConfig['hvm'].get('pae', 0)
     2.7 -        self.acpi  = imageConfig['hvm'].get('acpi', 0)
     2.8          self.apic  = imageConfig['hvm'].get('apic', 0)
     2.9 +        self.acpi  = imageConfig['hvm']['devices'].get('acpi', 0)
    2.10 +        
    2.11  
    2.12      def buildDomain(self):
    2.13          store_evtchn = self.vm.getStorePort()
    2.14 @@ -310,8 +311,6 @@ class HVMImageHandler(ImageHandler):
    2.15          
    2.16          for a in dmargs:
    2.17              v = hvmDeviceConfig.get(a)
    2.18 -            if a == 'vcpus':
    2.19 -                v = hvmDeviceConfig.get('vcpus_number')
    2.20  
    2.21              # python doesn't allow '-' in variable names
    2.22              if a == 'stdvga': a = 'std-vga'