ia64/xen-unstable

changeset 13486:9447d715956b

Solaris should used a netback of type 'SUNW_mac' and 'vif-vnic' as the
vif-script by default.

Signed-off-by: David Edmondson <dme@sun.com>
author john.levon@sun.com
date Tue Jan 16 19:44:09 2007 -0800 (2007-01-16)
parents 074170d7284c
children e7eb9b7613bb
files tools/python/xen/xend/XendOptions.py tools/python/xen/xend/osdep.py tools/python/xen/xend/server/netif.py
line diff
     1.1 --- a/tools/python/xen/xend/XendOptions.py	Thu Jan 18 15:07:51 2007 +0000
     1.2 +++ b/tools/python/xen/xend/XendOptions.py	Tue Jan 16 19:44:09 2007 -0800
     1.3 @@ -104,6 +104,12 @@ class XendOptions:
     1.4      """Default xend management state storage."""
     1.5      xend_state_path_default = '/var/lib/xend/state'
     1.6  
     1.7 +    """Default type of backend network interfaces"""
     1.8 +    netback_type = osdep.netback_type
     1.9 +
    1.10 +    """Default script to configure a backend network interface"""
    1.11 +    vif_script = osdep.vif_script
    1.12 +
    1.13      def __init__(self):
    1.14          self.configure()
    1.15  
    1.16 @@ -228,7 +234,7 @@ class XendOptions:
    1.17          return self.get_config_bool('enable-dump', 'no')
    1.18  
    1.19      def get_vif_script(self):
    1.20 -        return self.get_config_string('vif-script', 'vif-bridge')
    1.21 +        return self.get_config_string('vif-script', self.vif_script)
    1.22  
    1.23      def get_dom0_min_mem(self):
    1.24          return self.get_config_int('dom0-min-mem', self.dom0_min_mem_default)
     2.1 --- a/tools/python/xen/xend/osdep.py	Thu Jan 18 15:07:51 2007 +0000
     2.2 +++ b/tools/python/xen/xend/osdep.py	Tue Jan 16 19:44:09 2007 -0800
     2.3 @@ -33,9 +33,19 @@ import os
     2.4      "SunOS": "/usr/lib/xen/bin/pygrub"
     2.5  }
     2.6  
     2.7 +_netback_type = {
     2.8 +    "SunOS": "SUNW_mac"
     2.9 +}
    2.10 +
    2.11 +_vif_script = {
    2.12 +    "SunOS": "vif-vnic"
    2.13 +}
    2.14 +
    2.15  def _get(var, default=None):
    2.16      return var.get(os.uname()[0], default)
    2.17  
    2.18  scripts_dir = _get(_scripts_dir, "/etc/xen/scripts")
    2.19  xend_autorestart = _get(_xend_autorestart)
    2.20  pygrub_path = _get(_pygrub_path, "/usr/bin/pygrub")
    2.21 +netback_type = _get(_netback_type, "netfront")
    2.22 +vif_script = _get(_vif_script, "vif-bridge")
     3.1 --- a/tools/python/xen/xend/server/netif.py	Thu Jan 18 15:07:51 2007 +0000
     3.2 +++ b/tools/python/xen/xend/server/netif.py	Tue Jan 16 19:44:09 2007 -0800
     3.3 @@ -150,9 +150,8 @@ class NetifController(DevController):
     3.4  
     3.5          devid = self.allocateDeviceID()
     3.6  
     3.7 -        # The default type is 'netfront'.
     3.8          if not typ:
     3.9 -            typ = 'netfront'
    3.10 +            typ = xoptions.netback_type
    3.11              
    3.12          if not mac:
    3.13              mac = randomMAC()