Re: [Qemu-devel] [PATCH] scsi-bus: fix endianness bug in store_lun()

2013-03-16 Thread Benjamin Herrenschmidt
On Sat, 2013-03-16 at 14:09 +0100, Paolo Bonzini wrote: > > 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,

Re: [Qemu-devel] [PATCH] scsi-bus: fix endianness bug in store_lun()

2013-03-16 Thread Alexey Kardashevskiy
On 17/03/13 00:01, Benjamin Herrenschmidt wrote: 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/manu

Re: [Qemu-devel] [PATCH] scsi-bus: fix endianness bug in store_lun()

2013-03-16 Thread Paolo Bonzini
Il 16/03/2013 14:01, Benjamin Herrenschmidt ha scritto: > 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/staticfi

Re: [Qemu-devel] [PATCH] scsi-bus: fix endianness bug in store_lun()

2013-03-16 Thread Benjamin Herrenschmidt
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.pd

Re: [Qemu-devel] [PATCH] scsi-bus: fix endianness bug in store_lun()

2013-03-16 Thread Alexey Kardashevskiy
On 16/03/13 19:13, Paolo Bonzini wrote: Il 16/03/2013 08:16, Alexey Kardashevskiy ha scritto: SCSI protocol is defined as big endian. The SCSI command REPORT_LUNS returns the list of LUNs, 8 bytes each. The store_lun() function is called from scsi_target_emulate_report_luns() to fill the LUNs l

Re: [Qemu-devel] [PATCH] scsi-bus: fix endianness bug in store_lun()

2013-03-16 Thread Paolo Bonzini
Il 16/03/2013 08:16, Alexey Kardashevskiy ha scritto: > SCSI protocol is defined as big endian. The SCSI command REPORT_LUNS > returns the list of LUNs, 8 bytes each. > > The store_lun() function is called from scsi_target_emulate_report_luns() > to fill the LUNs list which is sent later to a gues

[Qemu-devel] [PATCH] scsi-bus: fix endianness bug in store_lun()

2013-03-16 Thread Alexey Kardashevskiy
SCSI protocol is defined as big endian. The SCSI command REPORT_LUNS returns the list of LUNs, 8 bytes each. The store_lun() function is called from scsi_target_emulate_report_luns() to fill the LUNs list which is sent later to a guest a response. However it puts the 2 bytes long big-endian value