ia64/xen-unstable

changeset 12202:7aa8f5bb3e28

Fix handling of SXP for devices through device_add -- this solves the
Invalid device (uname) problem that breaks just about everything once you've
done xm block-attach.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Sun Oct 29 19:28:26 2006 +0000 (2006-10-29)
parents 1f95b2a54f4c
children 33e9c88aab02
files tools/python/xen/xend/XendConfig.py
line diff
     1.1 --- a/tools/python/xen/xend/XendConfig.py	Fri Oct 27 18:15:14 2006 +0100
     1.2 +++ b/tools/python/xen/xend/XendConfig.py	Sun Oct 29 19:28:26 2006 +0000
     1.3 @@ -769,12 +769,10 @@ class XendConfig(dict):
     1.4              log.debug("XendConfig.device_add: %s" % str(cfg_xenapi))
     1.5  
     1.6          if cfg_sxp:
     1.7 -            config = sxp.child0(cfg_sxp)
     1.8 -            dev_type = sxp.name(config)
     1.9              dev_info = {}
    1.10  
    1.11              try:
    1.12 -                for opt, val in config[1:]:
    1.13 +                for opt, val in cfg_sxp[1:]:
    1.14                      dev_info[opt] = val
    1.15              except ValueError:
    1.16                  pass # SXP has no options for this device
    1.17 @@ -856,7 +854,7 @@ class XendConfig(dict):
    1.18          """
    1.19          sxpr = []
    1.20          if dev_uuid != None and dev_uuid in self['device']:
    1.21 -            dev_type, dev_info = self['device']
    1.22 +            dev_type, dev_info = self['device'][dev_uuid]
    1.23  
    1.24          if dev_type == None or dev_info == None:
    1.25              raise XendConfigError("Required either UUID or device type and "