PR implementation

This commit is contained in:
Le Zhang
2016-10-25 10:34:13 +08:00
parent f724702ecb
commit 82e6d230a2
19 changed files with 2382 additions and 75 deletions

View File

@@ -65,6 +65,8 @@ func GetTargetLUNMap(tgtName string) api.LUNMap {
}
func InitSCSILUMap(config *config.Config) error {
var simpleOp *SCSISimpleReservationOperator
var ok bool
globalSCSILUMap.mutex.Lock()
defer globalSCSILUMap.mutex.Unlock()
@@ -83,6 +85,11 @@ func InitSCSILUMap(config *config.Config) error {
return errors.New("LU Number must be a number")
}
mappingLUN(deviceID, lun, tgtName)
//Init SCSISimpleReservationOperator
op := GetSCSIReservationOperator()
if simpleOp, ok = op.(*SCSISimpleReservationOperator); ok {
simpleOp.InitLUReservation(tgtName, deviceID)
}
}
}
return nil