Skip to content

Commit

Permalink
Release 5.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Jan 29, 2025
1 parent e682708 commit d8fbe46
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 30 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
SCAN_HOST: ${{ secrets.SCAN_HOST }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_SCANNER_VERSION: 6.2.1.4610
SONAR_SCANNER_VERSION: 7.0.0.4796
BUILD_WRAPPER_OUT_DIR: "$HOME/.build_wrapper_out"
APT_PACKAGES: protobuf-compiler libspdlog-dev libpcap-dev libgmock-dev

Expand Down Expand Up @@ -69,4 +69,5 @@ jobs:
--define sonar.sonarLanguages=c++ \
--define sonar.branch.name=${{ inputs.branch }} \
--define sonar.exclusions="obj/**,lib/**,bin/**,generated/**" \
--define sonar.cpd.exclusions="s2pdump/sg_executor.h" \
--define sonar.test.inclusions=test/**
8 changes: 4 additions & 4 deletions cpp/command/command_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -575,17 +575,17 @@ string CommandExecutor::PrintCommand(const PbCommand &command, const PbDeviceDef
}

if (!pb_device.vendor().empty()) {
s << ", vendor='" << pb_device.vendor();
s << ", vendor='" << pb_device.vendor() << '\'';
}
if (!pb_device.product().empty()) {
s << "', product='" << pb_device.product();
s << ", product='" << pb_device.product() << '\'';
}
if (!pb_device.revision().empty()) {
s << "', revision='" << pb_device.revision();
s << ", revision='" << pb_device.revision() << '\'';
}

if (pb_device.block_size()) {
s << "', block size=" << pb_device.block_size();
s << ", block size=" << pb_device.block_size();
}

if (pb_device.caching_mode() != PbCachingMode::DEFAULT) {
Expand Down
26 changes: 13 additions & 13 deletions cpp/command/command_localizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// SCSI2Pi, SCSI device emulator and SCSI tools for the Raspberry Pi
//
// Copyright (C) 2021-2024 Uwe Seimet
// Copyright (C) 2021-2025 Uwe Seimet
//
//---------------------------------------------------------------------------

Expand Down Expand Up @@ -92,24 +92,24 @@ CommandLocalizer::CommandLocalizer()
Add(LocalizationKey::ERROR_NON_EXISTING_UNIT, "es", "Comando para ID %1 inexistente, unidad %2");
Add(LocalizationKey::ERROR_NON_EXISTING_UNIT, "zh", "不存在的 ID %1, 单元 %2 的指令");

Add(LocalizationKey::ERROR_UNKNOWN_DEVICE_TYPE, "en", "%1:%2: Unknown device type %1");
Add(LocalizationKey::ERROR_UNKNOWN_DEVICE_TYPE, "de", "%1:%2: Unbekannter Gerätetyp %1");
Add(LocalizationKey::ERROR_UNKNOWN_DEVICE_TYPE, "sv", "%1:%2: Obekant enhetstyp: %1");
Add(LocalizationKey::ERROR_UNKNOWN_DEVICE_TYPE, "fr", "%1:%2: Type de périphérique inconnu %1");
Add(LocalizationKey::ERROR_UNKNOWN_DEVICE_TYPE, "es", "%1:%2: Tipo de dispositivo desconocido %1");
Add(LocalizationKey::ERROR_UNKNOWN_DEVICE_TYPE, "zh", "%1:%2: 未知设备类型 %1");
Add(LocalizationKey::ERROR_UNKNOWN_DEVICE_TYPE, "en", "%1:%2: Unknown device type %3");
Add(LocalizationKey::ERROR_UNKNOWN_DEVICE_TYPE, "de", "%1:%2: Unbekannter Gerätetyp %3");
Add(LocalizationKey::ERROR_UNKNOWN_DEVICE_TYPE, "sv", "%1:%2: Obekant enhetstyp: %3");
Add(LocalizationKey::ERROR_UNKNOWN_DEVICE_TYPE, "fr", "%1:%2: Type de périphérique inconnu %3");
Add(LocalizationKey::ERROR_UNKNOWN_DEVICE_TYPE, "es", "%1:%2: Tipo de dispositivo desconocido %3");
Add(LocalizationKey::ERROR_UNKNOWN_DEVICE_TYPE, "zh", "%1:%2: 未知设备类型 %3");

Add(LocalizationKey::ERROR_MISSING_DEVICE_TYPE, "en",
"%1:%2: Device type required for unknown extension of file '%1'");
"%1:%2: Device type required for unknown extension of file '%3'");
Add(LocalizationKey::ERROR_MISSING_DEVICE_TYPE, "de",
"%1:%2: Gerätetyp erforderlich für unbekannte Extension der Datei '%1'");
"%1:%2: Gerätetyp erforderlich für unbekannte Extension der Datei '%3'");
Add(LocalizationKey::ERROR_MISSING_DEVICE_TYPE, "sv",
"%1:%2: Man måste ange enhetstyp för obekant filändelse '%1'");
"%1:%2: Man måste ange enhetstyp för obekant filändelse '%3'");
Add(LocalizationKey::ERROR_MISSING_DEVICE_TYPE, "fr",
"%1:%2: Type de périphérique requis pour extension inconnue du fichier '%1'");
"%1:%2: Type de périphérique requis pour extension inconnue du fichier '%3'");
Add(LocalizationKey::ERROR_MISSING_DEVICE_TYPE, "es",
"%1:%2: Tipo de dispositivo requerido para la extensión desconocida del archivo '%1'");
Add(LocalizationKey::ERROR_MISSING_DEVICE_TYPE, "zh", "%1:%2: 文件'%1'的未知扩展名所需的设备类型");
"%1:%2: Tipo de dispositivo requerido para la extensión desconocida del archivo '%3'");
Add(LocalizationKey::ERROR_MISSING_DEVICE_TYPE, "zh", "%1:%2: 文件'%3'的未知扩展名所需的设备类型");

Add(LocalizationKey::ERROR_DUPLICATE_ID, "en", "Duplicate ID %1, unit %2");
Add(LocalizationKey::ERROR_DUPLICATE_ID, "de", "Doppelte ID %1, Einheit %2");
Expand Down
2 changes: 1 addition & 1 deletion cpp/controllers/controller_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ class ControllerFactory
shared_ptr<ScriptGenerator> script_generator;

spdlog::level::level_enum log_level = spdlog::get_level();
string log_pattern = "[%Y-%m-%d %H:%M:%S.%e] [%^%l%$] %n %v";
string log_pattern = "%n [%^%l%$] %v";
};
4 changes: 1 addition & 3 deletions cpp/s2p/s2p_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ bool S2p::InitBus(bool in_process, bool log_signals)
return false;
}

s2p_logger = CreateLogger("[" + APP_NAME + "]");
s2p_logger = CreateLogger(APP_NAME);

executor = make_unique<CommandExecutor>(*bus, controller_factory, *s2p_logger);

Expand Down Expand Up @@ -408,8 +408,6 @@ void S2p::AttachInitialDevices(PbCommand &command)
}
#endif
}

dispatcher->SetLogLevel(log_level);
}

bool S2p::CheckActive(const property_map &properties, const string &id_and_lun)
Expand Down
2 changes: 1 addition & 1 deletion cpp/s2p/s2p_thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void S2pThread::ExecuteCommand(int fd) const
}
}
catch (const IoException &e) {
warn(e.what());
s2p_logger->warn(e.what());

// Try to return an error message (this may fail if the exception was caused when returning the actual result)
PbResult result;
Expand Down
1 change: 1 addition & 0 deletions cpp/s2pdump/s2pdump_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ set<int> S2pDumpExecutor::ReportLuns()
{
vector<uint8_t> buf(512);
vector<uint8_t> cdb(12);
cdb[0] = static_cast<uint8_t>(ScsiCommand::REPORT_LUNS);
SetInt16(cdb, 8, buf.size());

return ReportLuns(cdb, buf);
Expand Down
2 changes: 1 addition & 1 deletion cpp/shared/s2p_version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@

const int s2p_major_version = 5;
const int s2p_minor_version = 0;
const int s2p_revision = 0;
const int s2p_revision = 1;
const std::string s2p_suffix = "";
4 changes: 2 additions & 2 deletions cpp/shared/sg_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ void sg_util::SetInt24(span<uint8_t> buf, int offset, int value)
{
assert(buf.size() > static_cast<size_t>(offset) + 2);

buf[offset] = static_cast<uint8_t>(value >> 16);
buf[offset + 1] = static_cast<uint8_t>(value >> 8);
buf[offset] = static_cast<uint8_t>(static_cast<uint32_t>(value) >> 16);
buf[offset + 1] = static_cast<uint8_t>(static_cast<uint32_t>(value) >> 8);
buf[offset + 2] = static_cast<uint8_t>(value);
}
6 changes: 3 additions & 3 deletions cpp/test/tape_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ TEST(TapeTest, Read16)
{
auto [controller, tape] = CreateTape();

Dispatch(tape, ScsiCommand::READ_6, SenseKey::NOT_READY, Asc::MEDIUM_NOT_PRESENT);
Dispatch(tape, ScsiCommand::READ_16, SenseKey::NOT_READY, Asc::MEDIUM_NOT_PRESENT);

tape->SetReady(true);

Expand Down Expand Up @@ -412,7 +412,7 @@ TEST(TapeTest, Write6)
{
auto [controller, tape] = CreateTape();

Dispatch(tape, ScsiCommand::READ_6, SenseKey::NOT_READY, Asc::MEDIUM_NOT_PRESENT);
Dispatch(tape, ScsiCommand::WRITE_6, SenseKey::NOT_READY, Asc::MEDIUM_NOT_PRESENT);

tape->SetReady(true);

Expand Down Expand Up @@ -482,7 +482,7 @@ TEST(TapeTest, Write16)
{
auto [controller, tape] = CreateTape();

Dispatch(tape, ScsiCommand::READ_6, SenseKey::NOT_READY, Asc::MEDIUM_NOT_PRESENT);
Dispatch(tape, ScsiCommand::WRITE_16, SenseKey::NOT_READY, Asc::MEDIUM_NOT_PRESENT);

tape->SetReady(true);

Expand Down
2 changes: 1 addition & 1 deletion doc/s2p.1
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ n is the SCSI/SASI ID (0-7). u (0-31) is the optional LUN (logical unit). The de
FILE is the name of the image file to use for the SCSI/SASI device. For devices that do not support an image file the filename may have a special meaning or a dummy name can be provided. For SCDP it is an optional prioritized list of network interfaces, an optional IP address and netmask, e.g. "interface=eth0,eth1,wlan0:inet=10.10.20.1/24". For SCLP it is the print command to be used and a reservation timeout in seconds, e.g. "cmd=lp -oraw %f:timeout=60". For SCTP append mode can be configured with "append=MAXIMUM_FILE_SIZE".
.TP
.BR --type/-t\fI " " \fITYPE
The optional case-insensitive device type (SAHD, SCHD, SCRM, SCCD, SCMO, SCDP, SCLP, SCHS). If no type is specified for devices that support an image file, s2p tries to derive the type from the file extension.
The optional case-insensitive device type (SAHD, SCHD, SCRM, SCCD, SCMO, SCDP, SCLP, SCTP, SCSG, SCHS). If no type is specified for devices that support an image file, s2p tries to derive the type from the file extension.
.TP
.BR --scsi-level\fI " " \fITYPE
The optional SCSI standard level. The default level is device-specific and usually is SCSI-2. Be careful with using this option, you will usually not need it.
Expand Down
2 changes: 2 additions & 0 deletions doc/s2pctl.1
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ Specifies the device type. This type overrides the type derived from the file ex
scmo: Magneto-optical disk
scdp: DaynaPort network adapter
sclp: SCSI printer
sctp: SCSI tape drive (streamer)
scsg: SCSI-to-USBb bridge
schs: Host services device
.TP
.BR --name/-n\fI " " \fIVENDOR:PRODUCT:REVISION
Expand Down

0 comments on commit d8fbe46

Please sign in to comment.