aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorcl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>2005-06-17 17:23:06 +0000
committercl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>2005-06-17 17:23:06 +0000
commit8994c2f2ef6a2d804b41ac35906ce9c60a0301fc (patch)
tree40083dd2072972bd11959ffdef462dd457399e2d /tools
parent53f499bc57c139a0a11f915f283565bf38e19ed3 (diff)
downloadxen-8994c2f2ef6a2d804b41ac35906ce9c60a0301fc.tar.gz
xen-8994c2f2ef6a2d804b41ac35906ce9c60a0301fc.tar.bz2
xen-8994c2f2ef6a2d804b41ac35906ce9c60a0301fc.zip
bitkeeper revision 1.1713.3.10 (42b306faXfFxqDZahYvvQJPQeaDm1A)
netif.py: Add mtu config option for network interfaces. Signed-off-by: Mike Wray <mike.wray@hp.com> Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/python/xen/xend/server/netif.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/python/xen/xend/server/netif.py b/tools/python/xen/xend/server/netif.py
index c799c621c1..8c60904ec5 100755
--- a/tools/python/xen/xend/server/netif.py
+++ b/tools/python/xen/xend/server/netif.py
@@ -87,6 +87,7 @@ class NetDev(Dev):
self.bridge = None
self.script = None
self.ipaddr = None
+ self.mtu = None
self.vifname = None
self.configure(self.config, recreate=recreate)
@@ -132,6 +133,15 @@ class NetDev(Dev):
val = None
return val
+ def _get_config_mtu(self, config):
+ mtu = sxp.child_value(config, 'mtu')
+ if not mtu: return None
+ try:
+ mtu = int(mtu)
+ except:
+ raise XendError("invalid mtu: %s" & mtu)
+ return mtu
+
def configure(self, config, change=False, recreate=False):
if change:
return self.reconfigure(config)
@@ -156,6 +166,7 @@ class NetDev(Dev):
self.bridge = sxp.child_value(config, 'bridge')
self.script = sxp.child_value(config, 'script')
self.ipaddr = self._get_config_ipaddr(config) or []
+ self.mtu = self._get_config_mtu(config)
self._config_credit_limit(config)
try:
@@ -187,6 +198,7 @@ class NetDev(Dev):
bridge = sxp.child_value(config, 'bridge')
script = sxp.child_value(config, 'script')
ipaddr = self._get_config_ipaddr(config)
+ mtu = self._get_config_mtu(config)
xd = get_component('xen.xend.XendDomain')
backendDomain = xd.domain_lookup_by_name(sxp.child_value(config, 'backend', '0')).id
@@ -203,6 +215,8 @@ class NetDev(Dev):
changes['script'] = script
if (ipaddr is not None) and (ipaddr != self.ipaddr):
changes['ipaddr'] = ipaddr
+ if (mtu is not None) and (mtu != self.mtu):
+ changes['mtu'] = mtu
if changes:
self.vifctl("down")