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"