Skip to content

Commit

Permalink
Update handling of device type selection
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Dec 11, 2023
1 parent f9a56b9 commit 7511419
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cpp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ BOARD ?= FULLSPEC

CXXFLAGS += -DBOARD_$(BOARD)

## DEVICES=LIST
## Lists of devices to build, default is all. Supported devices:
## BUILD_*=1
## Specifies the device types to build, default is all. Supported types:
## SCHD SCSI Removable and non-removable Hard Drive
## SCCD SCSI CD-Rom Drive
## SCMO SCSI Optical Memory
Expand Down
6 changes: 6 additions & 0 deletions cpp/controllers/generic_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,8 @@ void GenericController::DataOutNonBlockOriented() const
}
}

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
bool GenericController::XferIn(vector<uint8_t> &buf)
{
assert(IsDataIn());
Expand Down Expand Up @@ -630,7 +632,10 @@ bool GenericController::XferIn(vector<uint8_t> &buf)

return true;
}
#pragma GCC diagnostic pop

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
bool GenericController::XferOutBlockOriented(bool cont)
{
auto device = GetDeviceForLun(GetEffectiveLun());
Expand Down Expand Up @@ -728,6 +733,7 @@ bool GenericController::XferOutBlockOriented(bool cont)

return true;
}
#pragma GCC diagnostic pop

void GenericController::ProcessCommand()
{
Expand Down
12 changes: 12 additions & 0 deletions cpp/shared_command/command_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ bool CommandExecutor::Attach(const CommandContext &context, const PbDeviceDefini
return true;
}

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
bool CommandExecutor::Insert(const CommandContext &context, const PbDeviceDefinition &pb_device,
const shared_ptr<PrimaryDevice> &device, bool dryRun) const
{
Expand Down Expand Up @@ -327,6 +329,7 @@ bool CommandExecutor::Insert(const CommandContext &context, const PbDeviceDefini

return true;
}
#pragma GCC diagnostic pop

bool CommandExecutor::Detach(const CommandContext &context, PrimaryDevice &device, bool dryRun) const
{
Expand Down Expand Up @@ -396,6 +399,8 @@ string CommandExecutor::SetReservedIds(string_view ids)
return "";
}

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
bool CommandExecutor::ValidateImageFile(const CommandContext &context, StorageDevice &storage_device,
const string &filename) const
{
Expand Down Expand Up @@ -431,7 +436,10 @@ bool CommandExecutor::ValidateImageFile(const CommandContext &context, StorageDe

return true;
}
#pragma GCC diagnostic pop

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
bool CommandExecutor::CheckForReservedFile(const CommandContext &context, const string &filename)
{
#ifdef BUILD_DISK
Expand All @@ -443,6 +451,7 @@ bool CommandExecutor::CheckForReservedFile(const CommandContext &context, const

return true;
}
#pragma GCC diagnostic pop

string CommandExecutor::PrintCommand(const PbCommand &command, const PbDeviceDefinition &pb_device) const
{
Expand Down Expand Up @@ -545,6 +554,8 @@ shared_ptr<PrimaryDevice> CommandExecutor::CreateDevice(const CommandContext &co
return device;
}

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
bool CommandExecutor::SetSectorSize(const CommandContext &context, shared_ptr<PrimaryDevice> device, int size) const
{
#ifdef BUILD_DISK
Expand All @@ -564,6 +575,7 @@ bool CommandExecutor::SetSectorSize(const CommandContext &context, shared_ptr<Pr

return true;
}
#pragma GCC diagnostic pop

bool CommandExecutor::ValidateOperationAgainstDevice(const CommandContext &context, const PrimaryDevice &device,
PbOperation operation)
Expand Down
3 changes: 3 additions & 0 deletions cpp/shared_command/command_response.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ void CommandResponse::GetDeviceTypesInfo(PbDeviceTypesInfo &device_types_info) c
}
}

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
void CommandResponse::GetDevice(shared_ptr<Device> device, PbDevice &pb_device, const string &default_folder) const
{
pb_device.set_id(device->GetId());
Expand Down Expand Up @@ -108,6 +110,7 @@ void CommandResponse::GetDevice(shared_ptr<Device> device, PbDevice &pb_device,
}
#endif
}
#pragma GCC diagnostic pop

bool CommandResponse::GetImageFile(PbImageFile &image_file, const string &default_folder, const string &filename) const
{
Expand Down
3 changes: 3 additions & 0 deletions cpp/shared_command/image_support.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ bool S2pImage::SetImagePermissions(const CommandContext &context) const
return context.ReturnSuccessStatus();
}

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
bool S2pImage::IsReservedFile(const CommandContext &context, const string &file, const string &op)
{
#ifdef BUILD_DISK
Expand All @@ -310,6 +312,7 @@ bool S2pImage::IsReservedFile(const CommandContext &context, const string &file,
return false;
#endif
}
#pragma GCC diagnostic pop

bool S2pImage::ValidateParams(const CommandContext &context, const string &op, string &from, string &to) const
{
Expand Down

0 comments on commit 7511419

Please sign in to comment.