Add a new backend store that enables iSCSI targets backed by
S3-compatible object storage (AWS S3, MinIO, Ceph RGW, etc.).
The implementation uses a chunked storage strategy where the virtual
block device is divided into fixed-size chunks (default 4 MiB), each
stored as an independent S3 object. This enables efficient random
read/write access on top of object storage.
Key features:
- Chunked storage with configurable chunk size
- Sparse device support (unwritten chunks treated as zeros)
- Concurrent multi-chunk I/O via errgroup
- Per-chunk locking for safe read-modify-write
- AWS SDK v2 with default credential chain
- In-process gofakes3 test server (no Docker needed)
- 12 unit tests + 2 integration tests
Also updates CI workflow to run S3 backend tests and updates
README with S3 backend documentation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix target delete URL path mismatch (/targets/ -> /target/)
- Implement target create/delete server handlers with proper validation
- Add DeleteTarget method with force flag and mutex locking to SCSITargetService
- Implement full LU management: create/list/delete through CLI, client, and server
- Add TPGT list command to show target portal group tags
- Add unit tests for target/LU router handlers and SCSI service
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix versionMatcher regex: gorilla/mux does not support (?:) syntax,
and -dirty suffix was required instead of optional
- Replace unsafe.Pointer LUN casts with binary.LittleEndian.Uint64
in sbc.go, scsi.go, and target.go
- Implement graceful HTTP server shutdown with 5s timeout using
srv.Shutdown() instead of raw listener close
- Replace golang.org/x/net/context with standard library context
- Respect existing req.Cancel value in canceler to avoid overwriting
- Add early context cancellation check in Do() to fail fast
Based on review of PR #120 by @orzhang, with fixes applied.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The UNMAP command was a no-op in all backing stores, causing unmapped
blocks to retain stale data instead of returning zeros per SCSI spec.
- Implement Unmap in FileBackingStore to zero out unmapped blocks
- Implement Unmap in IOUringBackingStore to zero out unmapped blocks
- Enable Unmap in RemBackingStore (was commented out)
- Change UnmapBlockDescriptor.TL from uint32 to uint64 to prevent
integer overflow when converting block count to byte length with
large block shifts
Fixes#119
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- support Block Limits VPD page (0xB0)
- add UNMAP to REPORT SUPPORTED OPERATION CODES
- READ CAPACITY(16): set LBPME when Thin provisioning is enabled
- move Thinprovisioning and BlockShift to config
- add Unmap to BackingStore