Implement tell and seek for tapes - #79
Conversation
|
This has been implemented very quickly and I'm not very familiar with how scsi works, but at least on linux appears to do the right thing. How it was tested is documented in the commit log. |
There was a problem hiding this comment.
Pull request overview
Adds support for tape position reporting (“tell”) and repositioning (“seek”) by wiring up the relevant SCSI opcode(s) to the SSC backing store implementation.
Changes:
- Route the SCSI
SEEK_10(0x2b) opcode to the SSC request handler. - Extend
bs_sscto support larger block deltas (int64_t) for spacing/seeking. - Implement basic
READ_POSITIONandSEEK_10handling in the tape backing store path.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| usr/ssc.c | Enables SSC handling for the 0x2b opcode by mapping it to ssc_rw. |
| usr/bs_ssc.c | Implements SEEK_10 and updates READ_POSITION response behavior and block spacing types. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
fbbc9e7 to
0610bc1
Compare
|
FWIW, I'm using this here: https://sourceforge.net/p/dump/code/ci/v0.4b55-wip/ for testing. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
tgtadm --op update --mode sys --name State -v offline
tgt-admin -e -c /etc/tgt/targets.conf
tgtadm --op update --mode sys --name State -v ready
iscsiadm --mode node --targetname iqn.2007-03:virtual-tape:hostname --portal ${iscsi_host} --login
mtx -f /dev/tape/by-path/ip-fd01\:8b0\:bfcd\:100\:216\:3eff\:fee0\:7253\:3260-iscsi-iqn.2007-03\:virtual-tape\:hostname-lun-3-changer load 1 0
mt-st -f /dev/tape/by-path/ip-fd01\:8b0\:bfcd\:100\:216\:3eff\:fee0\:7253\:3260-iscsi-iqn.2007-03\:virtual-tape\:hostname-lun-1-nst rewind
mt-st -f /dev/tape/by-path/ip-fd01\:8b0\:bfcd\:100\:216\:3eff\:fee0\:7253\:3260-iscsi-iqn.2007-03\:virtual-tape\:hostname-lun-1-nst tell
At block 1.
mt-st -f /dev/tape/by-path/ip-fd01\:8b0\:bfcd\:100\:216\:3eff\:fee0\:7253\:3260-iscsi-iqn.2007-03\:virtual-tape\:hostname-lun-1-nst fsf
mt-st -f /dev/tape/by-path/ip-fd01\:8b0\:bfcd\:100\:216\:3eff\:fee0\:7253\:3260-iscsi-iqn.2007-03\:virtual-tape\:hostname-lun-1-nst tell
At block 327.
mt-st -f /dev/tape/by-path/ip-fd01\:8b0\:bfcd\:100\:216\:3eff\:fee0\:7253\:3260-iscsi-iqn.2007-03\:virtual-tape\:hostname-lun-1-nst eod
mt-st -f /dev/tape/by-path/ip-fd01\:8b0\:bfcd\:100\:216\:3eff\:fee0\:7253\:3260-iscsi-iqn.2007-03\:virtual-tape\:hostname-lun-1-nst tell
At block 2882.
mt-st -f /dev/tape/by-path/ip-fd01\:8b0\:bfcd\:100\:216\:3eff\:fee0\:7253\:3260-iscsi-iqn.2007-03\:virtual-tape\:hostname-lun-1-nst bsf
mt-st -f /dev/tape/by-path/ip-fd01\:8b0\:bfcd\:100\:216\:3eff\:fee0\:7253\:3260-iscsi-iqn.2007-03\:virtual-tape\:hostname-lun-1-nst tell
At block 2880.
mt-st -f /dev/tape/by-path/ip-fd01\:8b0\:bfcd\:100\:216\:3eff\:fee0\:7253\:3260-iscsi-iqn.2007-03\:virtual-tape\:hostname-lun-1-nst seek 300
At block 300.
mt-st -f /dev/tape/by-path/ip-fd01\:8b0\:bfcd\:100\:216\:3eff\:fee0\:7253\:3260-iscsi-iqn.2007-03\:virtual-tape\:hostname-lun-1-nst bsr
mt-st -f /dev/tape/by-path/ip-fd01\:8b0\:bfcd\:100\:216\:3eff\:fee0\:7253\:3260-iscsi-iqn.2007-03\:virtual-tape\:hostname-lun-1-nst tell
At block 299.
mt-st -f /dev/tape/by-path/ip-fd01\:8b0\:bfcd\:100\:216\:3eff\:fee0\:7253\:3260-iscsi-iqn.2007-03\:virtual-tape\:hostname-lun-1-nst fsr
mt-st -f /dev/tape/by-path/ip-fd01\:8b0\:bfcd\:100\:216\:3eff\:fee0\:7253\:3260-iscsi-iqn.2007-03\:virtual-tape\:hostname-lun-1-nst tell
At block 300.
tgtadm --op update --mode sys --name State -v offline tgt-admin -e -c /etc/tgt/targets.conf
tgtadm --op update --mode sys --name State -v ready
iscsiadm --mode node --targetname iqn.2007-03:virtual-tape:hostname --portal ${iscsi_host} --login mtx -f /dev/tape/by-path/ip-fd01:8b0:bfcd:100:216:3eff:fee0:7253:3260-iscsi-iqn.2007-03:virtual-tape:hostname-lun-3-changer load 1 0 mt-st -f /dev/tape/by-path/ip-fd01:8b0:bfcd:100:216:3eff:fee0:7253:3260-iscsi-iqn.2007-03:virtual-tape:hostname-lun-1-nst rewind mt-st -f /dev/tape/by-path/ip-fd01:8b0:bfcd:100:216:3eff:fee0:7253:3260-iscsi-iqn.2007-03:virtual-tape:hostname-lun-1-nst tell At block 1.
mt-st -f /dev/tape/by-path/ip-fd01:8b0:bfcd:100:216:3eff:fee0:7253:3260-iscsi-iqn.2007-03:virtual-tape:hostname-lun-1-nst fsf mt-st -f /dev/tape/by-path/ip-fd01:8b0:bfcd:100:216:3eff:fee0:7253:3260-iscsi-iqn.2007-03:virtual-tape:hostname-lun-1-nst tell At block 327.
mt-st -f /dev/tape/by-path/ip-fd01:8b0:bfcd:100:216:3eff:fee0:7253:3260-iscsi-iqn.2007-03:virtual-tape:hostname-lun-1-nst eod mt-st -f /dev/tape/by-path/ip-fd01:8b0:bfcd:100:216:3eff:fee0:7253:3260-iscsi-iqn.2007-03:virtual-tape:hostname-lun-1-nst tell At block 2882.
mt-st -f /dev/tape/by-path/ip-fd01:8b0:bfcd:100:216:3eff:fee0:7253:3260-iscsi-iqn.2007-03:virtual-tape:hostname-lun-1-nst bsf mt-st -f /dev/tape/by-path/ip-fd01:8b0:bfcd:100:216:3eff:fee0:7253:3260-iscsi-iqn.2007-03:virtual-tape:hostname-lun-1-nst tell At block 2880.
mt-st -f /dev/tape/by-path/ip-fd01:8b0:bfcd:100:216:3eff:fee0:7253:3260-iscsi-iqn.2007-03:virtual-tape:hostname-lun-1-nst seek 300 At block 300.
mt-st -f /dev/tape/by-path/ip-fd01:8b0:bfcd:100:216:3eff:fee0:7253:3260-iscsi-iqn.2007-03:virtual-tape:hostname-lun-1-nst bsr mt-st -f /dev/tape/by-path/ip-fd01:8b0:bfcd:100:216:3eff:fee0:7253:3260-iscsi-iqn.2007-03:virtual-tape:hostname-lun-1-nst tell At block 299.
mt-st -f /dev/tape/by-path/ip-fd01:8b0:bfcd:100:216:3eff:fee0:7253:3260-iscsi-iqn.2007-03:virtual-tape:hostname-lun-1-nst fsr mt-st -f /dev/tape/by-path/ip-fd01:8b0:bfcd:100:216:3eff:fee0:7253:3260-iscsi-iqn.2007-03:virtual-tape:hostname-lun-1-nst tell At block 300.