Hi Peter,
I have already programmed it only a little different:
and it works if you want to set it below 1500, but fails if you want to
go over 1500..
the domain start fails if it is set over 1500 (RTNETLINK answers:
Invalid argument)
Best Regards,
Udo Attila Fischer
PS: Maybe it the following code should not posted here but maybe it is
usefull if somebody want to change settings below 1500.
in the /etc/xen/scripts
--- vif-common.sh.orig 2009-10-24 01:15:59.000000000 +0200
+++ vif-common.sh 2009-10-26 16:15:54.000000000 +0100
@@ -63,6 +63,11 @@
vif="$vifname"
fi
+mtu=$(xenstore_read_default "$XENBUS_PATH/mtu" "")
+if [ "$mtu" ] && [ "$command" == "online" ]
+then
+ ip link set $vif mtu "$mtu"
+fi
frob_iptable()
{
in the xen phyton scripts directory:
--- xm/create.py.orig 2009-10-24 02:19:04.000000000 +0200
+++ xm/create.py 2009-10-24 02:22:07.000000000 +0200
@@ -354,7 +354,7 @@
keymap overrides the XendD configured default layout file.""")
gopts.var('vif',
val="type=TYPE,mac=MAC,bridge=BRIDGE,ip=IPADDR,script=SCRIPT," + \
- "backend=DOM,vifname=NAME,rate=RATE,model=MODEL,accel=ACCEL",
+
"backend=DOM,vifname=NAME,rate=RATE,model=MODEL,accel=ACCEL,mtu=MTU",
fn=append_value, default=[],
use="""Add a network interface with the given MAC address and
bridge.
The vif is configured by calling the given configuration script.
@@ -850,7 +850,7 @@
def f(k):
if k not in ['backend', 'bridge', 'ip', 'mac', 'script',
'type',
'vifname', 'rate', 'model', 'accel',
- 'policy', 'label']:
+ 'policy', 'label', 'mtu']:
err('Invalid vif option: ' + k)
config_vif.append([k, d[k]])
--- xend/server/netif.py.orig 2009-01-05 21:27:55.000000000 +0100
+++ xend/server/netif.py 2009-10-24 03:46:17.000000000 +0200
@@ -115,6 +115,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.")
@@ -141,6 +142,8 @@
back['accel'] = accel
if sec_lab:
back['security_label'] = sec_lab
+ if mtu:
+ back['mtu'] = mtu
back['handle'] = "%i" % devid
back['script'] = os.path.join(xoptions.network_script_dir, script)
@@ -187,7 +190,7 @@
for x in ( 'script', 'ip', 'bridge', 'mac',
'type', 'vifname', 'rate', 'uuid', 'model', 'accel',
- 'security_label'):
+ 'security_label', 'mtu'):
if transaction is None:
y = self.readBackend(devid, x)
else:
--- xm/main.py.orig 2009-10-24 02:55:52.000000000 +0200
+++ xm/main.py 2009-10-24 03:02:08.000000000 +0200
@@ -188,7 +188,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.'),
@@ -2416,7 +2416,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 = {
@@ -2465,7 +2465,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:]:
--- xend/XendDomainInfo.py.orig 2009-10-24 05:05:37.000000000 +0200
+++ xend/XendDomainInfo.py 2009-10-24 05:25:20.000000000 +0200
@@ -3213,7 +3213,8 @@
# some point we're going to have to figure out how to
# handle that properly.
- config['MTU'] = 1500 # TODO
+ #config['MTU'] = 1500 # TODO
+ config['MTU'] = config.get('mtu', 1500) # TODO
if self._stateGet() not in (XEN_API_VM_POWER_STATE_HALTED,):
xennode = XendNode.instance()
smime.p7s
Description: S/MIME Cryptographic Signature
_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users
|