Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mininet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Olaf Bergmann
mininet
Commits
e3621eb0
Commit
e3621eb0
authored
15 years ago
by
Brandon Heller
Browse files
Options
Downloads
Patches
Plain Diff
Move fixLimits function to util
parent
89bf3103
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mininet/net.py
+2
-7
2 additions, 7 deletions
mininet/net.py
mininet/util.py
+8
-1
8 additions, 1 deletion
mininet/util.py
with
10 additions
and
8 deletions
mininet/net.py
+
2
−
7
View file @
e3621eb0
...
@@ -71,12 +71,11 @@
...
@@ -71,12 +71,11 @@
from
time
import
sleep
from
time
import
sleep
import
os
,
re
,
signal
,
sys
,
select
import
os
,
re
,
signal
,
sys
,
select
flush
=
sys
.
stdout
.
flush
flush
=
sys
.
stdout
.
flush
from
resource
import
setrlimit
,
RLIMIT_NPROC
,
RLIMIT_NOFILE
from
mininet.logging_mod
import
lg
,
set_loglevel
from
mininet.logging_mod
import
lg
,
set_loglevel
from
mininet.node
import
Node
,
Host
,
Controller
,
Switch
from
mininet.node
import
Node
,
Host
,
Controller
,
Switch
from
mininet.util
import
run
,
checkRun
,
quietRun
,
makeIntfPair
,
moveIntf
from
mininet.util
import
run
,
checkRun
,
quietRun
,
makeIntfPair
,
moveIntf
from
mininet.util
import
createLink
from
mininet.util
import
createLink
,
setLimits
DATAPATHS
=
[
'
user
'
,
'
kernel
'
]
DATAPATHS
=
[
'
user
'
,
'
kernel
'
]
...
@@ -532,11 +531,7 @@ def run( self ):
...
@@ -532,11 +531,7 @@ def run( self ):
else
:
else
:
lg
.
error
(
"
cli: unknown node or command: < %s >
\n
"
%
first
)
lg
.
error
(
"
cli: unknown node or command: < %s >
\n
"
%
first
)
lg
.
info
(
"
*** cli: exiting
\n
"
)
lg
.
info
(
"
*** cli: exiting
\n
"
)
def
fixLimits
():
"
Fix ridiculously small resource limits.
"
setrlimit
(
RLIMIT_NPROC
,
(
4096
,
8192
)
)
setrlimit
(
RLIMIT_NOFILE
,
(
16384
,
32768
)
)
def
init
():
def
init
():
"
Initialize Mininet.
"
"
Initialize Mininet.
"
...
...
This diff is collapsed.
Click to expand it.
mininet/util.py
+
8
−
1
View file @
e3621eb0
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
'''
Utility functions for Mininet.
'''
'''
Utility functions for Mininet.
'''
from
time
import
sleep
from
time
import
sleep
from
resource
import
setrlimit
,
RLIMIT_NPROC
,
RLIMIT_NOFILE
import
select
import
select
from
subprocess
import
call
,
check_call
,
Popen
,
PIPE
,
STDOUT
from
subprocess
import
call
,
check_call
,
Popen
,
PIPE
,
STDOUT
...
@@ -166,4 +167,10 @@ def createLink(node1, node2):
...
@@ -166,4 +167,10 @@ def createLink(node1, node2):
retry
(
3
,
MOVEINTF_DELAY
,
moveIntf
,
intf2
,
node2
)
retry
(
3
,
MOVEINTF_DELAY
,
moveIntf
,
intf2
,
node2
)
node1
.
connection
[
intf1
]
=
(
node2
,
intf2
)
node1
.
connection
[
intf1
]
=
(
node2
,
intf2
)
node2
.
connection
[
intf2
]
=
(
node1
,
intf1
)
node2
.
connection
[
intf2
]
=
(
node1
,
intf1
)
return
intf1
,
intf2
return
intf1
,
intf2
\ No newline at end of file
def
fixLimits
():
'''
Fix ridiculously small resource limits.
'''
setrlimit
(
RLIMIT_NPROC
,
(
4096
,
8192
))
setrlimit
(
RLIMIT_NOFILE
,
(
16384
,
32768
))
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment