From 574d634fc293a10dc4bd0dcce5588e14da756751 Mon Sep 17 00:00:00 2001 From: Bob Lantz Date: Thu, 22 Jan 2015 12:08:43 -0800 Subject: [PATCH] Don't clean up links that may have been dumped into root NS. This should rarely happen - in the usual case, either the links will be shut down by Mininet.stop(), or the interfaces will be deleted by node.stop( deleteIntfs=True ), or the links or interfaces will be explicitly deleted or stopped using the low-level API. Cases that are relying on links being automatically deleted in cleanup() will potentially find that they are now no longer deleted, but these cases should be rare. --- mininet/link.py | 7 ++++--- mininet/node.py | 11 ++++------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/mininet/link.py b/mininet/link.py index af895a1..4a1a683 100644 --- a/mininet/link.py +++ b/mininet/link.py @@ -197,9 +197,10 @@ class Intf( object ): def delete( self ): "Delete interface" self.cmd( 'ip link del ' + self.name ) - if self.node.inNamespace: - # Link may have been dumped into root NS - quietRun( 'ip link del ' + self.name ) + # We used to do this, but it slows us down: + # if self.node.inNamespace: + # Link may have been dumped into root NS + # quietRun( 'ip link del ' + self.name ) def status( self ): "Return intf status as a string" diff --git a/mininet/node.py b/mininet/node.py index e416261..ec473e0 100644 --- a/mininet/node.py +++ b/mininet/node.py @@ -194,10 +194,11 @@ class Node( object ): def cleanup( self ): "Help python collect its garbage." + # We used to do this, but it slows us down: # Intfs may end up in root NS - for intfName in self.intfNames(): - if self.name in intfName: - quietRun( 'ip link del ' + intfName ) + # for intfName in self.intfNames(): + # if self.name in intfName: + # quietRun( 'ip link del ' + intfName ) self.shell = None # Subshell I/O, commands and control @@ -1311,10 +1312,6 @@ class OVSBatch( OVSSwitch ): super( OVSBatch, self ).stop( *args, **kwargs ) self.started = False - def cleanup( self): - "Don't bother to clean up" - return - class IVSSwitch( Switch ): "Indigo Virtual Switch"