From: Ewan Mellor Date: Sun, 29 Oct 2006 19:28:26 +0000 (+0000) Subject: Fix handling of SXP for devices through device_add -- this solves the X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15567^2~157^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=ad0cc561450d9f86dec9074e7298dc9ddc18c370;p=xen.git 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 --- diff --git a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py index a911a642fe..7449ec54eb 100644 --- a/tools/python/xen/xend/XendConfig.py +++ b/tools/python/xen/xend/XendConfig.py @@ -769,12 +769,10 @@ class XendConfig(dict): log.debug("XendConfig.device_add: %s" % str(cfg_xenapi)) if cfg_sxp: - config = sxp.child0(cfg_sxp) - dev_type = sxp.name(config) dev_info = {} try: - for opt, val in config[1:]: + for opt, val in cfg_sxp[1:]: dev_info[opt] = val except ValueError: pass # SXP has no options for this device @@ -856,7 +854,7 @@ class XendConfig(dict): """ sxpr = [] if dev_uuid != None and dev_uuid in self['device']: - dev_type, dev_info = self['device'] + dev_type, dev_info = self['device'][dev_uuid] if dev_type == None or dev_info == None: raise XendConfigError("Required either UUID or device type and "