On Sat, 2013-03-16 at 23:11 +1100, Alexey Kardashevskiy wrote: > > No, LUNs are composed of four 2-byte big-endian values. > > I cannot find it in "SCSI Commands References Manual" > (for example here - > http://www.seagate.com/staticfiles/support/disc/manuals/Interface% > 20manuals/100293068c.pdf > ). It just says that it is 8 bytes per > LUN and SCSI itself is big endian. Could you please point me to > the correct spec?
The confusion comes from the old SCSI protocol LUN as a 2 bytes number identifying a unit for a given bus/device and the "new style" LUN as a more generic concept such as used in SRP (ie vscsi is SRP) which encompass the bus, ID and LUN in one big number. The actual type of LUN returned by REPORT_LUN depends on the SELECT_REPORT field (I don't remember the details, but the doco you point to say to see what's in SAM-4) and the result is *variable* in size, so it should be kosher for qemu to just return 2 bytes as long as the LUN_LIST_LENGTH field of the reply is correct. So it all needs a bit of double checking but I wouldn't be surprised if at the end of the day the culprit was my SLOF code :-) Cheers, Ben.