Do not consider NONE operation an error (#369)

* Do not consider NONE operation an error

* Cleanup

* Code cleanup from other PR
This commit is contained in:
Uwe Seimet 2021-10-24 08:10:31 +02:00 committed by GitHub
parent 34befb9fad
commit dcbee64750
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 2 deletions

View File

@ -356,7 +356,7 @@ void SASIDEV::Execute()
ctrl.execstart = SysTimer::GetTimerLow(); ctrl.execstart = SysTimer::GetTimerLow();
// Discard pending sense data from the previous command if the current command is not REQUEST SENSE // Discard pending sense data from the previous command if the current command is not REQUEST SENSE
if(SASIDEV::eCmdRequestSense != (SASIDEV::sasi_command)ctrl.cmd[0]) { if ((SASIDEV::sasi_command)ctrl.cmd[0] != SASIDEV::eCmdRequestSense) {
ctrl.status = 0; ctrl.status = 0;
ctrl.device->SetStatusCode(0); ctrl.device->SetStatusCode(0);
} }

View File

@ -262,7 +262,7 @@ void SCSIDEV::Execute()
ctrl.device = ctrl.unit[lun]; ctrl.device = ctrl.unit[lun];
// Discard pending sense data from the previous command // Discard pending sense data from the previous command if the current command is not REQUEST SENSE
if ((SCSIDEV::scsi_command)ctrl.cmd[0] != eCmdRequestSense) { if ((SCSIDEV::scsi_command)ctrl.cmd[0] != eCmdRequestSense) {
ctrl.device->SetStatusCode(0); ctrl.device->SetStatusCode(0);
} }

View File

@ -959,6 +959,11 @@ bool ProcessCmd(int fd, const PbDeviceDefinition& pb_device, const PbCommand& co
assert(dryRun); assert(dryRun);
break; break;
case NONE:
// Do nothing, just log
LOGTRACE("Received %s command", PbOperation_Name(operation).c_str());
break;
default: default:
return ReturnStatus(fd, false, "Unknown operation"); return ReturnStatus(fd, false, "Unknown operation");
} }