[stgt] Fun iscsi trick
ronniesahlberg at gmail.com
Fri Jun 19 11:06:17 CEST 2009
A pointless post, but my mind was juggled by the RFC referrals
recently on the list, and I thought this was somewhat amusing.
Appologies if not.
Regarding iSCSI, it is surprising what you can get away with and still
interoperate with initiators.
I have my own (many many years old) iSCSI hack and SCSI SBC hack that
is the kind of minimal subset of code you need in order to get
windows, linux and bsd/macos initiators to log in and access a file
as a block device.
It used to clock in at about 1000 linjes for iscsi and about 1000
lines for SCSI SBC.
(I would one day want to revive this code and cut it down further. How
small can a program be to be a useful iSCSI/SCSI-SBC emulation?)
Anyway, as far as targets go, you dont need to implement iSCSI SCSI
Response (opcode 0x21) at all!
If instead you send the initiators a iSCSI Data-IN (0x25) with data
segment length==0 and the S flag set they will happily accept it just
fine, even if the CDB was something like TestUnitReady!
Works just fine, and makes your target smaller :-)
I would like to see if I can get a iSCSI + SBC emulation going in <
1000 lines of code. That would be cool.
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
More information about the stgt