mapping lun and fix portal management

This commit is contained in:
Le Zhang
2016-10-04 13:39:55 +08:00
parent 89382bddb0
commit c9b93c7527
16 changed files with 298 additions and 119 deletions

View File

@@ -146,6 +146,7 @@ func SPCInquiry(host int, cmd *api.SCSICommand) api.SAMStat {
b = (uint8(0) & 0x7) << 5
b |= uint8(0) & 0x1f
}
fmt.Println(cmd.Device.Lun, *(*uint64)(unsafe.Pointer(&cmd.Lun)))
if cmd.Device.Lun != *(*uint64)(unsafe.Pointer(&cmd.Lun)) {
goto sense
}
@@ -235,7 +236,8 @@ func SPCReportLuns(host int, cmd *api.SCSICommand) api.SAMStat {
buf.WriteByte(0x00)
}
for _, lu := range cmd.Target.Devices {
for lunumber, lu := range cmd.Target.Devices {
fmt.Println("LUN:", lunumber)
if remainLength > 0 {
lun := lu.Lun
if lun > 0xff {