* MTU configuration option on VIF interfaces
@ 2009-10-18 20:13 Peter Viskup
2009-10-26 22:16 ` Pasi Kärkkäinen
0 siblings, 1 reply; 3+ messages in thread
From: Peter Viskup @ 2009-10-18 20:13 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 367 bytes --]
Hello all,
I did some 'development' work and not sure if it will work.
I would have possibility to set MTU size for virtual interfaces.
I tried to set mtu in /etc/xen/scripts/vif-nat first, but this did not work.
Could somebody review my diff's made on Debian Lenny? You know - I am
not a python developer and not a developer at all. ;-)
Best regards,
Peter Viskup
[-- Attachment #2: xen.diff --]
[-- Type: text/x-patch, Size: 2024 bytes --]
/usr/lib/xen-3.2-1/lib/python/xen/xend/XendDomainInfo.py
2625,2629c2625
< # config['MTU'] = 1500 # TODO
< if not config.has_key('MTU'):
< config['MTU'] = config.get('mtu', '')
< else:
< config['MTU'] = 1500
---
> config['MTU'] = 1500 # TODO
/usr/lib/xen-3.2-1/lib/python/xen/xend/server/netif.py
117d116
< mtu = config.get('mtu')
125,126c124
< 'mac' : mac,
< 'mtu' : mtu }
---
> 'mac' : mac }
158,159c156
< 'mac' : mac,
< 'mtu' : mtu }
---
> 'mac' : mac }
198c195
< 'security_label', 'mtu'):
---
> 'security_label'):
205c202
< model, accel, security_label, mtu) = devinfo
---
> model, accel, security_label) = devinfo
229,230d225
< if mtu:
< result['mtu'] = mtu
/usr/lib/xen-3.2-1/lib/python/xen/xend/XendVnet.py
97c97
< def vifctl(self, op, vif, vmac, vmtu):
---
> def vifctl(self, op, vif, vmac):
100c100
< return vnet_cmd([fn, ['vnet', self.id], ['vif', vif], ['vmac', vmac], ['vmtu', vmtu]])
---
> return vnet_cmd([fn, ['vnet', self.id], ['vif', vif], ['vmac', vmac]])
102c102
< log.warning("vifctl failed: op=%s vif=%s mac=%s", op, vif, vmac, vmtu)
---
> log.warning("vifctl failed: op=%s vif=%s mac=%s", op, vif, vmac)
/usr/lib/xen-3.2-1/lib/python/xen/xm/main.py
168c168
< '[accel=<accel>] [mtu=<mtu>]',
---
> '[accel=<accel>]',
2129c2129
< 'backend', 'vifname', 'rate', 'model', 'accel', 'mtu']
---
> 'backend', 'vifname', 'rate', 'model', 'accel']
2178,2180c2178
< lambda x: set(['other_config', 'accel'], x),
< 'mtu':
< lambda x: set(['other_config', 'mtu'], x)
---
> lambda x: set(['other_config', 'accel'], x)
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: MTU configuration option on VIF interfaces
2009-10-18 20:13 MTU configuration option on VIF interfaces Peter Viskup
@ 2009-10-26 22:16 ` Pasi Kärkkäinen
2009-10-27 10:49 ` Peter Viskup
0 siblings, 1 reply; 3+ messages in thread
From: Pasi Kärkkäinen @ 2009-10-26 22:16 UTC (permalink / raw)
To: Peter Viskup; +Cc: xen-devel
On Sun, Oct 18, 2009 at 10:13:12PM +0200, Peter Viskup wrote:
> Hello all,
> I did some 'development' work and not sure if it will work.
> I would have possibility to set MTU size for virtual interfaces.
> I tried to set mtu in /etc/xen/scripts/vif-nat first, but this did not work.
> Could somebody review my diff's made on Debian Lenny? You know - I am
> not a python developer and not a developer at all. ;-)
>
Well.. at least first please send an unified diff (diff -u) :)
-- Pasi
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: MTU configuration option on VIF interfaces
2009-10-26 22:16 ` Pasi Kärkkäinen
@ 2009-10-27 10:49 ` Peter Viskup
0 siblings, 0 replies; 3+ messages in thread
From: Peter Viskup @ 2009-10-27 10:49 UTC (permalink / raw)
To: Pasi Kärkkäinen; +Cc: xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 4592 bytes --]
Ok, here they are:
START of diffs
==============
--- /usr/lib/xen-3.2-1/lib/python/xen/xend/XendDomainInfo.py.original
2009-10-16 12:41:42.000000000 +0200
+++ /usr/lib/xen-3.2-1/lib/python/xen/xend/XendDomainInfo.py 2009-10-16
12:45:48.000000000 +0200
@@ -2622,7 +2622,11 @@
# some point we're going to have to figure out how to
# handle that properly.
- config['MTU'] = 1500 # TODO
+# config['MTU'] = 1500 # TODO
+ if not config.has_key('MTU'):
+ config['MTU'] = config.get('mtu', '')
+ else:
+ config['MTU'] = 1500
if self._stateGet() not in (XEN_API_VM_POWER_STATE_HALTED,):
xennode = XendNode.instance()
--- /usr/lib/xen-3.2-1/lib/python/xen/xend/server/netif.py.original
2009-10-16 16:58:56.000000000 +0200
+++ /usr/lib/xen-3.2-1/lib/python/xen/xend/server/netif.py 2009-10-16
17:29:53.000000000 +0200
@@ -114,6 +114,7 @@
model = config.get('model')
accel = config.get('accel')
sec_lab = config.get('security_label')
+ mtu = config.get('mtu')
if not mac:
raise VmError("MAC address not specified or generated.")
@@ -121,7 +122,8 @@
devid = self.allocateDeviceID()
back = { 'script' : script,
- 'mac' : mac }
+ 'mac' : mac,
+ 'mtu' : mtu }
if typ:
back['type'] = typ
if ipaddr:
@@ -153,7 +155,8 @@
front = {}
if typ != 'ioemu':
front = { 'handle' : "%i" % devid,
- 'mac' : mac }
+ 'mac' : mac,
+ 'mtu' : mtu }
if security.on():
self.do_access_control(config)
@@ -192,14 +195,14 @@
devinfo = ()
for x in ( 'script', 'ip', 'bridge', 'mac',
'type', 'vifname', 'rate', 'uuid', 'model', 'accel',
- 'security_label'):
+ 'security_label', 'mtu'):
if transaction is None:
y = self.vm._readVm(config_path + x)
else:
y = self.vm._readVmTxn(transaction, config_path + x)
devinfo += (y,)
(script, ip, bridge, mac, typ, vifname, rate, uuid,
- model, accel, security_label) = devinfo
+ model, accel, security_label, mtu) = devinfo
if script:
result['script'] = script
@@ -223,5 +226,7 @@
result['accel'] = accel
if security_label:
result['security_label'] = security_label
+ if mtu:
+ result['mtu'] = mtu
return result
--- /usr/lib/xen-3.2-1/lib/python/xen/xend/XendVnet.py.original 2009-10-16
16:07:09.000000000 +0200
+++ /usr/lib/xen-3.2-1/lib/python/xen/xend/XendVnet.py 2009-10-16
16:08:33.000000000 +0200
@@ -94,12 +94,12 @@
xstransact.Remove(self.dbpath)
return val
- def vifctl(self, op, vif, vmac):
+ def vifctl(self, op, vif, vmac, vmtu):
try:
fn = self.vifctl_ops[op]
- return vnet_cmd([fn, ['vnet', self.id], ['vif', vif], ['vmac', vmac]])
+ return vnet_cmd([fn, ['vnet', self.id], ['vif', vif], ['vmac', vmac],
['vmtu', vmtu]])
except XendError:
- log.warning("vifctl failed: op=%s vif=%s mac=%s", op, vif, vmac)
+ log.warning("vifctl failed: op=%s vif=%s mac=%s", op, vif, vmac, vmtu)
class XendVnet:
"""Index of all vnets. Singleton.
--- /usr/lib/xen-3.2-1/lib/python/xen/xm/main.py.original 2009-10-16
15:32:01.000000000 +0200
+++ /usr/lib/xen-3.2-1/lib/python/xen/xm/main.py 2009-10-16
15:51:43.000000000 +0200
@@ -165,7 +165,7 @@
'network-attach': ('<Domain> [type=<type>] [mac=<mac>] [bridge=<bridge>] '
'[ip=<ip>] [script=<script>] [backend=<BackDomain>] '
'[vifname=<name>] [rate=<rate>] [model=<model>]'
- '[accel=<accel>]',
+ '[accel=<accel>] [mtu=<mtu>]',
'Create a new virtual network device.'),
'network-detach': ('<Domain> <DevId> [-f|--force]',
'Destroy a domain\'s virtual network device.'),
@@ -2126,7 +2126,7 @@
dom = args[0]
vif = ['vif']
vif_params = ['type', 'mac', 'bridge', 'ip', 'script', \
- 'backend', 'vifname', 'rate', 'model', 'accel']
+ 'backend', 'vifname', 'rate', 'model', 'accel', 'mtu']
if serverType == SERVER_XEN_API:
vif_record = {
@@ -2175,7 +2175,9 @@
'model':
lambda x: None,
'accel':
- lambda x: set(['other_config', 'accel'], x)
+ lambda x: set(['other_config', 'accel'], x),
+ 'mtu':
+ lambda x: set(['other_config', 'mtu'], x)
}
for a in args[1:]:
===========
END of diffs
On Mon, Oct 26, 2009 at 11:16 PM, Pasi Kärkkäinen <pasik@iki.fi> wrote:
> On Sun, Oct 18, 2009 at 10:13:12PM +0200, Peter Viskup wrote:
> > Hello all,
> > I did some 'development' work and not sure if it will work.
> > I would have possibility to set MTU size for virtual interfaces.
> > I tried to set mtu in /etc/xen/scripts/vif-nat first, but this did not
> work.
> > Could somebody review my diff's made on Debian Lenny? You know - I am
> > not a python developer and not a developer at all. ;-)
> >
>
> Well.. at least first please send an unified diff (diff -u) :)
>
> -- Pasi
>
>
>
[-- Attachment #1.2: Type: text/html, Size: 6089 bytes --]
[-- Attachment #2: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-10-27 10:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-18 20:13 MTU configuration option on VIF interfaces Peter Viskup
2009-10-26 22:16 ` Pasi Kärkkäinen
2009-10-27 10:49 ` Peter Viskup
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.