From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44799) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UH57A-0001lI-7W for qemu-devel@nongnu.org; Sun, 17 Mar 2013 00:22:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UH54e-0002V5-RJ for qemu-devel@nongnu.org; Sun, 17 Mar 2013 00:19:58 -0400 Message-ID: <1363483926.1244.28.camel@pasglop> From: Benjamin Herrenschmidt Date: Sun, 17 Mar 2013 02:32:06 +0100 In-Reply-To: <51446F27.8060909@redhat.com> References: <1363418170-3391-1-git-send-email-aik@ozlabs.ru> <514429B2.4010207@redhat.com> <5144616B.8040808@ozlabs.ru> <1363438887.1244.27.camel@pasglop> <51446F27.8060909@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] scsi-bus: fix endianness bug in store_lun() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Alexey Kardashevskiy , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, David Gibson 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, 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. > > No, that's wrong. Each LUN returned by REPORT LUNS is always 8 bytes. > The field tells you if you are reporting all LUNs, only well-known LUNs, > etc. Ok, my bad then, I misread the spec even more badly than Alexey did ;-) Anyway, the fix needs to be in SLOF. Cheers, Ben.