From d5ff71aae152b30edbe7183271a8ec1ba3ef1557 Mon Sep 17 00:00:00 2001 From: "john.levon@sun.com" Date: Tue, 16 Jan 2007 19:44:09 -0800 Subject: [PATCH] Solaris should used a netback of type 'SUNW_mac' and 'vif-vnic' as the vif-script by default. Signed-off-by: David Edmondson --- tools/python/xen/xend/XendOptions.py | 8 +++++++- tools/python/xen/xend/osdep.py | 10 ++++++++++ tools/python/xen/xend/server/netif.py | 3 +-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/tools/python/xen/xend/XendOptions.py b/tools/python/xen/xend/XendOptions.py index 3a97d09564..fac15eb15b 100644 --- a/tools/python/xen/xend/XendOptions.py +++ b/tools/python/xen/xend/XendOptions.py @@ -104,6 +104,12 @@ class XendOptions: """Default xend management state storage.""" xend_state_path_default = '/var/lib/xend/state' + """Default type of backend network interfaces""" + netback_type = osdep.netback_type + + """Default script to configure a backend network interface""" + vif_script = osdep.vif_script + def __init__(self): self.configure() @@ -228,7 +234,7 @@ class XendOptions: return self.get_config_bool('enable-dump', 'no') def get_vif_script(self): - return self.get_config_string('vif-script', 'vif-bridge') + return self.get_config_string('vif-script', self.vif_script) def get_dom0_min_mem(self): return self.get_config_int('dom0-min-mem', self.dom0_min_mem_default) diff --git a/tools/python/xen/xend/osdep.py b/tools/python/xen/xend/osdep.py index 1dd3c7c1dd..2136465ea7 100644 --- a/tools/python/xen/xend/osdep.py +++ b/tools/python/xen/xend/osdep.py @@ -33,9 +33,19 @@ _pygrub_path = { "SunOS": "/usr/lib/xen/bin/pygrub" } +_netback_type = { + "SunOS": "SUNW_mac" +} + +_vif_script = { + "SunOS": "vif-vnic" +} + def _get(var, default=None): return var.get(os.uname()[0], default) scripts_dir = _get(_scripts_dir, "/etc/xen/scripts") xend_autorestart = _get(_xend_autorestart) pygrub_path = _get(_pygrub_path, "/usr/bin/pygrub") +netback_type = _get(_netback_type, "netfront") +vif_script = _get(_vif_script, "vif-bridge") diff --git a/tools/python/xen/xend/server/netif.py b/tools/python/xen/xend/server/netif.py index 06310a82a1..bc755e9c9d 100644 --- a/tools/python/xen/xend/server/netif.py +++ b/tools/python/xen/xend/server/netif.py @@ -150,9 +150,8 @@ class NetifController(DevController): devid = self.allocateDeviceID() - # The default type is 'netfront'. if not typ: - typ = 'netfront' + typ = xoptions.netback_type if not mac: mac = randomMAC() -- 2.30.2