add the ability to delete luns at runtime
This commit is contained in:
@@ -87,6 +87,12 @@ func AddBackendStorage(bs config.BackendStorage) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func DelBackendStorage(deviceID uint64) {
|
||||
globalSCSILUMap.mutex.Lock()
|
||||
defer globalSCSILUMap.mutex.Unlock()
|
||||
delete(globalSCSILUMap.AllDevices, deviceID)
|
||||
}
|
||||
|
||||
func AddLUNMapping(m LUNMapping) error {
|
||||
globalSCSILUMap.mutex.Lock()
|
||||
defer globalSCSILUMap.mutex.Unlock()
|
||||
@@ -99,6 +105,12 @@ func AddLUNMapping(m LUNMapping) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func DelLUNMapping(m LUNMapping) {
|
||||
globalSCSILUMap.mutex.Lock()
|
||||
defer globalSCSILUMap.mutex.Unlock()
|
||||
delete(globalSCSILUMap.TargetsLUNMap[m.TargetName], m.LUN)
|
||||
}
|
||||
|
||||
func InitSCSILUMap(config *config.Config) error {
|
||||
for _, bs := range config.Storages {
|
||||
if err := AddBackendStorage(bs); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user