Implement stats and resize and fix remote backing store apis

- Convert constant to var so that it can be configured from backend
- Add options to disable persistent reservation and ORWrite16 commands

Signed-off-by: Utkarsh Mani Tripathi <utkarsh.tripathi@mayadata.io>
This commit is contained in:
Utkarsh Mani Tripathi
2019-11-20 14:34:35 +05:30
parent d7caf89610
commit d7891b1f68
10 changed files with 190 additions and 50 deletions

View File

@@ -51,6 +51,7 @@ var (
)
type iscsiConnection struct {
ConnNum int
state int
authState int
session *ISCSISession
@@ -96,12 +97,13 @@ const (
)
type iscsiTask struct {
tag uint32
conn *iscsiConnection
cmd *ISCSICommand
scmd *api.SCSICommand
state taskState
result byte
tag uint32
conn *iscsiConnection
cmd *ISCSICommand
scmd *api.SCSICommand
state taskState
expectedDataLength int64
result byte
offset int
r2tCount int
@@ -154,6 +156,7 @@ func (conn *iscsiConnection) buildRespPackage(oc OpCode, task *iscsiTask) error
task = conn.rxTask
}
conn.resp = &ISCSICommand{
StartTime: conn.req.StartTime,
StatSN: conn.req.ExpStatSN,
TaskTag: conn.req.TaskTag,
ExpCmdSN: conn.session.ExpCmdSN,
@@ -172,6 +175,7 @@ func (conn *iscsiConnection) buildRespPackage(oc OpCode, task *iscsiTask) error
}
case OpSCSIIn, OpSCSIResp:
conn.resp.OpCode = oc
conn.resp.SCSIOpCode = conn.req.SCSIOpCode
conn.resp.Immediate = true
conn.resp.Final = true
conn.resp.SCSIResponse = 0x00