Error handling update

This commit is contained in:
Uwe Seimet 2021-08-22 18:08:57 +02:00
parent d3a9ae48af
commit c5b7f2ffd4
7 changed files with 15 additions and 7 deletions

View File

@ -242,7 +242,15 @@ void SCSIDEV::Execute()
ctrl.execstart = SysTimer::GetTimerLow();
ctrl.device = ctrl.unit[GetLun()];
ctrl.device->Dispatch(this);
try {
ctrl.device->Dispatch(this);
}
catch (const lun_exception& e) {
LOGINFO("%s Invalid LUN %d", __PRETTY_FUNCTION__, e.getlun());
Error(ERROR_CODES::sense_key::ILLEGAL_REQUEST, ERROR_CODES::asc::INVALID_LUN);
}
}
//---------------------------------------------------------------------------

View File

@ -1325,7 +1325,7 @@ void Disk::AddCommand(SCSIDEV::scsi_command opcode, const char* name, void (Disk
commands[opcode] = new command_t(name, execute);
}
bool Disk::Dispatch(SASIDEV *controller)
bool Disk::Dispatch(SCSIDEV *controller)
{
SASIDEV::ctrl_t *ctrl = controller->GetWorkAddr();

View File

@ -231,7 +231,7 @@ public:
bool Format(const DWORD *cdb); // FORMAT UNIT command
bool Reassign(const DWORD *cdb); // REASSIGN UNIT command
virtual bool Dispatch(SASIDEV *);
virtual bool Dispatch(SCSIDEV *);
protected:
// Internal processing

View File

@ -129,7 +129,7 @@ void SCSIDaynaPort::Open(const Filepath& path, BOOL attn)
commands[opcode] = new command_t(name, execute);
}
bool SCSIDaynaPort::Dispatch(SASIDEV *controller)
bool SCSIDaynaPort::Dispatch(SCSIDEV *controller)
{
SASIDEV::ctrl_t *ctrl = controller->GetWorkAddr();

View File

@ -90,7 +90,7 @@ public:
void CmdEnableInterface(SASIDEV *);
void CmdGetEventStatusNotification(SASIDEV *);
bool Dispatch(SASIDEV *);
bool Dispatch(SCSIDEV *);
const int DAYNAPORT_BUFFER_SIZE = 0x1000000;

View File

@ -271,7 +271,7 @@ void SCSICD::AddCommand(SCSIDEV::scsi_command opcode, const char* name, void (SC
commands[opcode] = new command_t(name, execute);
}
bool SCSICD::Dispatch(SASIDEV *controller)
bool SCSICD::Dispatch(SCSIDEV *controller)
{
SASIDEV::ctrl_t *ctrl = controller->GetWorkAddr();

View File

@ -105,7 +105,7 @@ public:
void LBAtoMSF(DWORD lba, BYTE *msf) const; // LBA→MSF conversion
DWORD MSFtoLBA(const BYTE *msf) const; // MSF→LBA conversion
bool Dispatch(SASIDEV *);
bool Dispatch(SCSIDEV *);
private:
// Open