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-api

[Xen-API] [PATCH] CA-39188: Change illegal MTU value to 1500 when creati

To: xen-api <xen-api@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-API] [PATCH] CA-39188: Change illegal MTU value to 1500 when creating Network
From: Rob Hoes <rob.hoes@xxxxxxxxxx>
Date: Thu, 25 Mar 2010 10:58:07 +0000
Delivery-date: Thu, 25 Mar 2010 03:58:17 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Rob Hoes <rob.hoes@xxxxxxxxxx>
CA-39188: Change illegal MTU value to 1500 when creating Network

There is already a default of 1500 in the datamodel for the Network.MTU field. 
However, language bindings tend to fill in their own default of 0 (which is 
illegal), when the field is not specified by the user.

Signed-off-by: Rob Hoes <rob.hoes@xxxxxxxxxx>

diff -r a8c9fb523f7e ocaml/xapi/xapi_network.ml
--- a/ocaml/xapi/xapi_network.ml        Thu Mar 25 09:49:35 2010 +0000
+++ b/ocaml/xapi/xapi_network.ml        Thu Mar 25 10:23:14 2010 +0000
@@ -124,6 +124,7 @@
        Mutex.execute mutex (fun () ->
                let networks = Db.Network.get_all ~__context in
                let bridges = List.map (fun self -> Db.Network.get_bridge 
~__context ~self) networks in
+               let mTU = if mTU <= 0L then 1500L else mTU in
                let rec loop () = 
                        let name = stem ^ (string_of_int !counter) in
                        incr counter;

Attachment: mtu-default
Description: Text document

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-API] [PATCH] CA-39188: Change illegal MTU value to 1500 when creating Network, Rob Hoes <=