diff --git a/cpp/s2pdump/s2pdump_executor.cpp b/cpp/s2pdump/s2pdump_executor.cpp index 637fb925..62035fbc 100644 --- a/cpp/s2pdump/s2pdump_executor.cpp +++ b/cpp/s2pdump/s2pdump_executor.cpp @@ -18,7 +18,7 @@ void S2pDumpExecutor::TestUnitReady() const { vector cdb(6); - phase_executor->Execute(scsi_command::cmd_test_unit_ready, cdb, { }, 0); + initiator_executor->Execute(scsi_command::cmd_test_unit_ready, cdb, { }, 0); } bool S2pDumpExecutor::Inquiry(span buffer, bool sasi) @@ -27,7 +27,7 @@ bool S2pDumpExecutor::Inquiry(span buffer, bool sasi) cdb[3] = static_cast(buffer.size() >> 8); cdb[4] = static_cast(buffer.size()); - return phase_executor->Execute(scsi_command::cmd_inquiry, cdb, buffer, static_cast(buffer.size()), sasi); + return initiator_executor->Execute(scsi_command::cmd_inquiry, cdb, buffer, static_cast(buffer.size()), sasi); } pair S2pDumpExecutor::ReadCapacity() @@ -35,7 +35,7 @@ pair S2pDumpExecutor::ReadCapacity() vector buffer(14); vector cdb(10); - if (!phase_executor->Execute(scsi_command::cmd_read_capacity10, cdb, buffer, 8)) { + if (!initiator_executor->Execute(scsi_command::cmd_read_capacity10, cdb, buffer, 8)) { return {0, 0}; } @@ -48,7 +48,7 @@ pair S2pDumpExecutor::ReadCapacity() // READ CAPACITY(16), not READ LONG(16) cdb[1] = 0x10; - if (!phase_executor->Execute(scsi_command::cmd_read_capacity16_read_long16, cdb, buffer, + if (!initiator_executor->Execute(scsi_command::cmd_read_capacity16_read_long16, cdb, buffer, static_cast(buffer.size()))) { return {0, 0}; } @@ -72,7 +72,7 @@ bool S2pDumpExecutor::ReadWrite(span buffer, uint32_t bstart, uint32_t cdb[3] = static_cast(bstart); cdb[4] = static_cast(blength); - return phase_executor->Execute(is_write ? scsi_command::cmd_write6 : scsi_command::cmd_read6, cdb, buffer, + return initiator_executor->Execute(is_write ? scsi_command::cmd_write6 : scsi_command::cmd_read6, cdb, buffer, length); } else { @@ -84,7 +84,7 @@ bool S2pDumpExecutor::ReadWrite(span buffer, uint32_t bstart, uint32_t cdb[7] = static_cast(blength >> 8); cdb[8] = static_cast(blength); - return phase_executor->Execute(is_write ? scsi_command::cmd_write10 : scsi_command::cmd_read10, cdb, buffer, + return initiator_executor->Execute(is_write ? scsi_command::cmd_write10 : scsi_command::cmd_read10, cdb, buffer, length); } } @@ -96,14 +96,14 @@ bool S2pDumpExecutor::ModeSense6(span buffer) cdb[2] = 0x3f; cdb[4] = static_cast(buffer.size()); - return phase_executor->Execute(scsi_command::cmd_mode_sense6, cdb, buffer, static_cast(buffer.size())); + return initiator_executor->Execute(scsi_command::cmd_mode_sense6, cdb, buffer, static_cast(buffer.size())); } void S2pDumpExecutor::SynchronizeCache() { vector cdb(10); - phase_executor->Execute(scsi_command::cmd_synchronize_cache10, cdb, { }, 0); + initiator_executor->Execute(scsi_command::cmd_synchronize_cache10, cdb, { }, 0); } set S2pDumpExecutor::ReportLuns() @@ -114,7 +114,7 @@ set S2pDumpExecutor::ReportLuns() cdb[9] = static_cast(buffer.size()); // Assume 8 LUNs in case REPORT LUNS is not available - if (!phase_executor->Execute(scsi_command::cmd_report_luns, cdb, buffer, static_cast(buffer.size()))) { + if (!initiator_executor->Execute(scsi_command::cmd_report_luns, cdb, buffer, static_cast(buffer.size()))) { trace("Target does not support REPORT LUNS"); return {0, 1, 2, 3, 4, 5, 6, 7}; } diff --git a/cpp/s2pdump/s2pdump_executor.h b/cpp/s2pdump/s2pdump_executor.h index 932fc9c5..f5f0ad7e 100644 --- a/cpp/s2pdump/s2pdump_executor.h +++ b/cpp/s2pdump/s2pdump_executor.h @@ -22,7 +22,7 @@ class S2pDumpExecutor S2pDumpExecutor(Bus &bus, int id) { - phase_executor = make_unique(bus, id); + initiator_executor = make_unique(bus, id); } ~S2pDumpExecutor() = default; @@ -36,7 +36,7 @@ class S2pDumpExecutor void SetTarget(int id, int lun) { - phase_executor->SetTarget(id, lun); + initiator_executor->SetTarget(id, lun); } private: @@ -44,5 +44,5 @@ class S2pDumpExecutor static uint32_t GetInt32(span, int = 0); static uint64_t GetInt64(span, int = 0); - unique_ptr phase_executor; + unique_ptr initiator_executor; }; diff --git a/cpp/s2pproto/s2pproto_executor.cpp b/cpp/s2pproto/s2pproto_executor.cpp index 1aed4298..eb5ec09b 100644 --- a/cpp/s2pproto/s2pproto_executor.cpp +++ b/cpp/s2pproto/s2pproto_executor.cpp @@ -104,8 +104,3 @@ string S2pProtoExecutor::Execute(const string &filename, protobuf_format input_f return ""; } - -bool S2pProtoExecutor::ExecuteCommand(scsi_command cmd, vector &cdb, vector &buffer, bool sasi) -{ - return initiator_executor->Execute(cmd, cdb, buffer, buffer.size(), sasi); -} diff --git a/cpp/s2pproto/s2pproto_executor.h b/cpp/s2pproto/s2pproto_executor.h index 2b205c72..a0bb6b35 100644 --- a/cpp/s2pproto/s2pproto_executor.h +++ b/cpp/s2pproto/s2pproto_executor.h @@ -38,7 +38,6 @@ class S2pProtoExecutor ~S2pProtoExecutor() = default; string Execute(const string&, protobuf_format, PbResult&); - bool ExecuteCommand(scsi_command, vector&, vector&, bool); void SetTarget(int id, int lun) {