support more SCSI commands: ReadDefectData, Sanitize, and expanded CI

New SCSI commands implemented:
- READ DEFECT DATA(10/12): returns empty defect list (virtual device)
- SANITIZE: supports OVERWRITE and BLOCK ERASE (zeros all blocks)
- EXTENDED COPY / RECEIVE COPY RESULTS: registered as unsupported

New unit tests for ReadDefectData10/12, Sanitize, and command registration.

New CI libiscsi test cases:
- PersistentReservation (PrinReadKeys, PrinReportCapabilities,
  ProutRegister, ProutReserve)
- ReadDefectData10/12 (Simple)
- CompareAndWrite (Simple)
- OrWrite (Simple, BeyondEol, ZeroBlocks)
- GetLBAStatus (Simple, BeyondEol)
- ReportSupportedOpcodes (OneCommand)

Partial fix for #55

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Lei Xue
2026-03-14 13:06:35 +08:00
parent 3c41cd619b
commit 36149cd4a9
4 changed files with 268 additions and 4 deletions

View File

@@ -83,6 +83,7 @@ var (
UNMAP SCSICommandType = 0x42
READ_TOC SCSICommandType = 0x43
GET_CONFIGURATION SCSICommandType = 0x46
SANITIZE SCSICommandType = 0x48
LOG_SELECT SCSICommandType = 0x4c
LOG_SENSE SCSICommandType = 0x4d
READ_DISK_INFO SCSICommandType = 0x51
@@ -95,6 +96,8 @@ var (
READ_BUFFER_CAP SCSICommandType = 0x5c
PERSISTENT_RESERVE_IN SCSICommandType = 0x5e
PERSISTENT_RESERVE_OUT SCSICommandType = 0x5f
EXTENDED_COPY SCSICommandType = 0x83
RECEIVE_COPY_RESULTS SCSICommandType = 0x84
VARLEN_CDB SCSICommandType = 0x7f
READ_16 SCSICommandType = 0x88
COMPARE_AND_WRITE SCSICommandType = 0x89
@@ -121,6 +124,7 @@ var (
SEARCH_HIGH_12 SCSICommandType = 0xb0
SEARCH_EQUAL_12 SCSICommandType = 0xb1
SEARCH_LOW_12 SCSICommandType = 0xb2
READ_DEFECT_DATA_12 SCSICommandType = 0xb7
READ_ELEMENT_STATUS SCSICommandType = 0xb8
SEND_VOLUME_TAG SCSICommandType = 0xb6
SET_STREAMING SCSICommandType = 0xb6