From 50ef39af82413ef463609f24173b22af13fad268 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Sun, 3 Aug 2008 18:19:55 -0700 Subject: 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. --- src/python/m5/simulate.py | 2 ++ src/python/swig/core.i | 3 +++ 2 files changed, 5 insertions(+) (limited to 'src/python') 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 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; -- cgit v1.2.3