direct-io.hg

changeset 12811:a4d1f99e5a53

[XEND] Keep vif IP addresses as space separated string.

They were inconsistently represented as strings or lists making it
difficult to know the type of the IP parameter for vifs. Since both xm
and DevController represents these as space separated strings, that is
what it will be stored as.

Signed-off-by: Alastair Tse <atse@xensource.com>
author Alastair Tse <atse@xensource.com>
date Fri Dec 08 13:31:21 2006 +0000 (2006-12-08)
parents 28403de6c415
children c519ab0f70f3
files tools/python/xen/xend/XendConfig.py tools/python/xen/xend/server/netif.py
line diff
     1.1 --- a/tools/python/xen/xend/XendConfig.py	Fri Dec 08 13:28:22 2006 +0000
     1.2 +++ b/tools/python/xen/xend/XendConfig.py	Fri Dec 08 13:31:21 2006 +0000
     1.3 @@ -922,24 +922,11 @@ class XendConfig(dict):
     1.4              except ValueError:
     1.5                  pass # SXP has no options for this device
     1.6  
     1.7 -
     1.8 -            # Special handling for certain device parameters.
     1.9 -
    1.10 -            def _get_config_ipaddr(cfg):
    1.11 -                val = []
    1.12 -                for ipaddr in sxp.children(cfg, elt='ip'):
    1.13 -                    val.append(sxp.child0(ipaddr))
    1.14 -                return val
    1.15 -
    1.16 -            if dev_type == 'vif' and 'ip' in dev_info:
    1.17 -                dev_info['ip'] = _get_config_ipaddr(config)
    1.18 -
    1.19              if dev_type == 'vbd':
    1.20                  if dev_info.get('dev', '').startswith('ioemu:'):
    1.21                      dev_info['driver'] = 'ioemu'
    1.22                  else:
    1.23                      dev_info['driver'] = 'paravirtualised'
    1.24 -                    
    1.25  
    1.26              # create uuid if it doesn't exist
    1.27              dev_uuid = dev_info.get('uuid', uuid.createString())
     2.1 --- a/tools/python/xen/xend/server/netif.py	Fri Dec 08 13:28:22 2006 +0000
     2.2 +++ b/tools/python/xen/xend/server/netif.py	Fri Dec 08 13:31:21 2006 +0000
     2.3 @@ -164,7 +164,7 @@ class NetifController(DevController):
     2.4              front = { 'handle' : "%i" % devid,
     2.5                        'mac'    : mac }
     2.6          if ipaddr:
     2.7 -            back['ip'] = ' '.join(ipaddr)
     2.8 +            back['ip'] = ipaddr
     2.9          if bridge:
    2.10              back['bridge'] = bridge
    2.11          if vifname:
    2.12 @@ -189,7 +189,7 @@ class NetifController(DevController):
    2.13              network_script_dir = xroot.network_script_dir + os.sep
    2.14              result['script'] = script.replace(network_script_dir, "")
    2.15          if ip:
    2.16 -            result['ip'] = ip.split(" ")
    2.17 +            result['ip'] = ip
    2.18          if bridge:
    2.19              result['bridge'] = bridge
    2.20          if mac: