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.
This commit is contained in:
@@ -182,3 +182,5 @@ def switchCpus(cpuList):
|
||||
|
||||
for old_cpu, new_cpu in cpuList:
|
||||
new_cpu.takeOverFrom(old_cpu)
|
||||
|
||||
from internal.core import disableAllListeners
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user