feat: implement cmd management for targets, LUNs, and TPGTs (fixes #36)
- 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>
This commit is contained in:
@@ -130,6 +130,13 @@ func DelLUNMapping(m LUNMapping) {
|
||||
delete(globalSCSILUMap.TargetsLUNMap[m.TargetName], m.LUN)
|
||||
}
|
||||
|
||||
// DelTargetLUNMap removes the entire LUN map for a target.
|
||||
func DelTargetLUNMap(targetName string) {
|
||||
globalSCSILUMap.mutex.Lock()
|
||||
defer globalSCSILUMap.mutex.Unlock()
|
||||
delete(globalSCSILUMap.TargetsLUNMap, targetName)
|
||||
}
|
||||
|
||||
func InitSCSILUMap(config *config.Config) error {
|
||||
for _, bs := range config.Storages {
|
||||
if err := AddBackendStorage(bs); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user