OSDN Git Service

spapr_vscsi: Fix REPORT_LUNS handling
authorNathan Whitehorn <nwhitehorn@freebsd.org>
Sun, 12 Jan 2014 22:34:21 +0000 (17:34 -0500)
committerAlexander Graf <agraf@suse.de>
Wed, 5 Mar 2014 02:06:26 +0000 (03:06 +0100)
commit3052f0d59426a1f8120ffbf66fd438973bfd2912
tree776ca6f425f9d342ea13b7e2de5a9efa9b25d87b
parent09aa9a526a86fd2e380e86157c55dfd180661c64
spapr_vscsi: Fix REPORT_LUNS handling

Intercept REPORT_LUNS commands addressed either to SRP LUN 0 or the well-known
LUN for REPORT_LUNS commands. This is required to implement the SAM and SPC
specifications.

Since SRP implements only a single SCSI target port per connection, the SRP
target is required to report all available LUNs in response to a REPORT_LUNS
command addressed either to LUN 0 or the well-known LUN. Instead, QEMU was
forwarding such requests to the first QEMU SCSI target, with the result that
initiators that relied on this feature would only see LUNs on the first QEMU
SCSI target.

Behavior for REPORT_LUNS commands addressed to any other LUN is not specified
by the standard and so is left unchanged. This preserves behavior under Linux
and SLOF, which enumerate possible LUNs by hand and so address no commands
either to LUN 0 or the well-known REPORT_LUNS LUN.

Signed-off-by: Nathan Whitehorn <nwhitehorn@freebsd.org>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
[agraf: define constant as ULL for 32bit hosts]
Signed-off-by: Alexander Graf <agraf@suse.de>
hw/scsi/spapr_vscsi.c