Added rascsi filter to limit logging to a particular device (#978)

* Support for ID and LUN parameter for the -L option in rascsi

* Added DeviceLogger class

* Removed dupiicate code

* Fixed SonarQube issues

* Added unit tests, improved code sharing

* Fixed regression (#979)
This commit is contained in:
Uwe Seimet
2022-11-11 21:08:48 +01:00
committed by GitHub
parent 4fa513090a
commit 454c61ac0d
47 changed files with 673 additions and 409 deletions
+6 -4
View File
@@ -16,7 +16,6 @@
// work with the Sharp X68000 operating system.
//---------------------------------------------------------------------------
#include "shared/log.h"
#include "shared/rascsi_exceptions.h"
#include "scsi_command_util.h"
#include "scsi_host_bridge.h"
@@ -27,6 +26,11 @@ using namespace std;
using namespace scsi_defs;
using namespace scsi_command_util;
SCSIBR::SCSIBR(int lun) : PrimaryDevice(SCBR, lun)
{
SupportsParams(true);
}
bool SCSIBR::Init(const unordered_map<string, string>& params)
{
PrimaryDevice::Init(params);
@@ -38,13 +42,11 @@ bool SCSIBR::Init(const unordered_map<string, string>& params)
AddCommand(scsi_command::eCmdGetMessage10, [this] { GetMessage10(); });
AddCommand(scsi_command::eCmdSendMessage10, [this] { SendMessage10(); });
SupportsParams(true);
#ifdef __linux__
// TAP Driver Generation
m_bTapEnable = tap.Init(GetParams());
if (!m_bTapEnable){
LOGERROR("Unable to open the TAP interface")
GetLogger().Error("Unable to open the TAP interface");
return false;
}
#endif