add the ability to add luns dynamically

This commit is contained in:
chessman
2019-06-11 18:24:18 +03:00
parent d90dab2b1d
commit f11001ec71
4 changed files with 55 additions and 19 deletions

View File

@@ -45,6 +45,15 @@ func (s *SCSITargetService) NewSCSITarget(tid int, driverName, name string) (*ap
return target, nil
}
func (s *SCSITargetService) RereadTargetLUNMap() {
s.mutex.Lock()
defer s.mutex.Unlock()
for _, tgt := range s.Targets {
tgt.Devices = GetTargetLUNMap(tgt.Name)
}
}
func FindTargetGroup(target *api.SCSITarget, relPortID uint16) uint16 {
for _, tpg := range target.TargetPortGroups {
for _, port := range tpg.TargetPortGroup {