summaryrefslogtreecommitdiff
path: root/src/python
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2008-08-03 18:19:55 -0700
committerNathan Binkert <nate@binkert.org>2008-08-03 18:19:55 -0700
commit50ef39af82413ef463609f24173b22af13fad268 (patch)
tree44fb10aeaf17c5055c2ae315f5bc52e25180a3d3 /src/python
parentede89c2d541051c2ed647e2967712e10b3c0fab0 (diff)
downloadgem5-50ef39af82413ef463609f24173b22af13fad268.tar.xz
sockets: Add a function to disable all listening sockets.
When invoking several copies of m5 on the same machine at the same time, there can be a race for TCP ports for the terminal connections or remote gdb. Expose a function to disable those ports, and have the regression scripts disable them. There are some SimObjects that have no other function than to be used with ports (NativeTrace and EtherTap), so they will panic if the ports are disabled.
Diffstat (limited to 'src/python')
-rw-r--r--src/python/m5/simulate.py2
-rw-r--r--src/python/swig/core.i3
2 files changed, 5 insertions, 0 deletions
diff --git a/src/python/m5/simulate.py b/src/python/m5/simulate.py
index 3d91da368..e4dbd5784 100644
--- a/src/python/m5/simulate.py
+++ b/src/python/m5/simulate.py
@@ -182,3 +182,5 @@ def switchCpus(cpuList):
for old_cpu, new_cpu in cpuList:
new_cpu.takeOverFrom(old_cpu)
+
+from internal.core import disableAllListeners
diff --git a/src/python/swig/core.i b/src/python/swig/core.i
index 53d992ac6..3d360c017 100644
--- a/src/python/swig/core.i
+++ b/src/python/swig/core.i
@@ -34,6 +34,7 @@
%{
#include "python/swig/pyobject.hh"
+#include "base/socket.hh"
#include "sim/core.hh"
#include "sim/host.hh"
#include "sim/startup.hh"
@@ -42,6 +43,7 @@ extern const char *compileDate;
std::vector<std::string> compileFlags();
extern const char *hgRev;
extern const char *hgDate;
+inline void disableAllListeners() { ListenSocket::disableAll(); }
%}
%include "stdint.i"
@@ -53,6 +55,7 @@ void setOutputDir(const std::string &dir);
void setOutputFile(const std::string &file);
void SimStartup();
void doExitCleanup();
+void disableAllListeners();
%immutable compileDate;
char *compileDate;