WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] netif.py:

ChangeSet 1.1713.1.23, 2005/06/17 18:23:06+01:00, cl349@xxxxxxxxxxxxxxxxxxxx

        netif.py:
          Add mtu config option for network interfaces.
        Signed-off-by: Mike Wray <mike.wray@xxxxxx>
        Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>



 netif.py |   14 ++++++++++++++
 1 files changed, 14 insertions(+)


diff -Nru a/tools/python/xen/xend/server/netif.py 
b/tools/python/xen/xend/server/netif.py
--- a/tools/python/xen/xend/server/netif.py     2005-06-17 21:03:46 -04:00
+++ b/tools/python/xen/xend/server/netif.py     2005-06-17 21:03:47 -04:00
@@ -87,6 +87,7 @@
         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 @@
             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 @@
         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 @@
         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 @@
             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")

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>