From 0b7c277ec217db90fb3b11d10dab9f18bd3be7fb Mon Sep 17 00:00:00 2001 From: Bob Lantz Date: Wed, 21 Mar 2012 23:07:40 -0700 Subject: [PATCH] Save parameters for future reference (e.g. OVS/tc workaround.) --- examples/limit.py | 2 +- mininet/link.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/limit.py b/examples/limit.py index 4514514..8f608e0 100755 --- a/examples/limit.py +++ b/examples/limit.py @@ -34,7 +34,7 @@ def testCpuLimit( net, cpu ): h1.cmd( 'kill %1') h2.cmd( 'kill %1') -def limit( bw=1, cpu=.3 ): +def limit( bw=1, cpu=.4 ): """Example/test of link and CPU bandwidth limits bw: interface bandwidth limit in Mbps cpu: cpu limit as fraction of overall CPU time""" diff --git a/mininet/link.py b/mininet/link.py index 09971d4..3c12be8 100644 --- a/mininet/link.py +++ b/mininet/link.py @@ -33,7 +33,7 @@ class Intf( object ): "Basic interface object that can configure itself." - def __init__( self, name, node=None, port=None, link=None, **kwargs ): + def __init__( self, name, node=None, port=None, link=None, **params ): """name: interface name (e.g. h1-eth0) node: owning node (where this intf most likely lives) link: parent link if we're part of a link @@ -44,7 +44,9 @@ class Intf( object ): self.mac, self.ip, self.prefixLen = None, None, None # Add to node (and move ourselves if necessary ) node.addIntf( self, port=port ) - self.config( **kwargs ) + # Save params for future reference + self.params = params + self.config( **params ) def cmd( self, *args, **kwargs ): "Run a command in our owning node"