qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] SCSI disk, set HISUP bit in INQ data
@ 2012-09-15  1:13 Ronnie Sahlberg
  2012-09-15  1:13 ` [Qemu-devel] [PATCH] SCSI: Standard INQUIRY data should report HiSup flag as set Ronnie Sahlberg
  0 siblings, 1 reply; 3+ messages in thread
From: Ronnie Sahlberg @ 2012-09-15  1:13 UTC (permalink / raw)
  To: pbonzini, qemu-devel

Paolo, List

Please find a trivial patch that make SCSI-DISK set the HISUP bit in the INQ data.
Since I think all LUN numbers are reported as SAM4 describes, we should set this bit.

Its already sed in SCSI-BUS


regards
ronnie sahlberg

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Qemu-devel] [PATCH] SCSI: Standard INQUIRY data should report HiSup flag as set.
  2012-09-15  1:13 [Qemu-devel] [PATCH] SCSI disk, set HISUP bit in INQ data Ronnie Sahlberg
@ 2012-09-15  1:13 ` Ronnie Sahlberg
  2012-09-17  9:17   ` Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Ronnie Sahlberg @ 2012-09-15  1:13 UTC (permalink / raw)
  To: pbonzini, qemu-devel; +Cc: Ronnie Sahlberg

QEMU as far as I know only reports LUN numbers using the modes that
are described in SAM4.
As such, since all LUN numbers generated by the SCSI emulation in QEMU
follow SAM4, we should set the HiSup bit in the standard INQUIRY data
to indicate such.

>From SAM4:
  4.6.3 LUNs overview
  All LUN formats described in this standard are hierarchical in
  structure even when only a single level in that hierarchy is used.
  The HISUP bit shall be set to one in the standard INQUIRY data
  (see SPC-4) when any LUN format described in this standard is used.
  Non-hierarchical formats are outside the scope of this standard.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
---
 hw/scsi-disk.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index 1585683..52bc062 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -678,7 +678,7 @@ static int scsi_disk_emulate_inquiry(SCSIRequest *req, uint8_t *outbuf)
      * is actually implemented, but we're good enough.
      */
     outbuf[2] = 5;
-    outbuf[3] = 2; /* Format 2 */
+    outbuf[3] = 2 | 0x10; /* Format 2, HiSup */
 
     if (buflen > 36) {
         outbuf[4] = buflen - 5; /* Additional Length = (Len - 1) - 4 */
-- 
1.7.3.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] SCSI: Standard INQUIRY data should report HiSup flag as set.
  2012-09-15  1:13 ` [Qemu-devel] [PATCH] SCSI: Standard INQUIRY data should report HiSup flag as set Ronnie Sahlberg
@ 2012-09-17  9:17   ` Paolo Bonzini
  0 siblings, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2012-09-17  9:17 UTC (permalink / raw)
  To: Ronnie Sahlberg; +Cc: qemu-devel

Il 15/09/2012 03:13, Ronnie Sahlberg ha scritto:
> QEMU as far as I know only reports LUN numbers using the modes that
> are described in SAM4.
> As such, since all LUN numbers generated by the SCSI emulation in QEMU
> follow SAM4, we should set the HiSup bit in the standard INQUIRY data
> to indicate such.
> 
> From SAM4:
>   4.6.3 LUNs overview
>   All LUN formats described in this standard are hierarchical in
>   structure even when only a single level in that hierarchy is used.
>   The HISUP bit shall be set to one in the standard INQUIRY data
>   (see SPC-4) when any LUN format described in this standard is used.
>   Non-hierarchical formats are outside the scope of this standard.
> 
> Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
> ---
>  hw/scsi-disk.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
> index 1585683..52bc062 100644
> --- a/hw/scsi-disk.c
> +++ b/hw/scsi-disk.c
> @@ -678,7 +678,7 @@ static int scsi_disk_emulate_inquiry(SCSIRequest *req, uint8_t *outbuf)
>       * is actually implemented, but we're good enough.
>       */
>      outbuf[2] = 5;
> -    outbuf[3] = 2; /* Format 2 */
> +    outbuf[3] = 2 | 0x10; /* Format 2, HiSup */
>  
>      if (buflen > 36) {
>          outbuf[4] = buflen - 5; /* Additional Length = (Len - 1) - 4 */
> 

Applied to scsi-next branch, thanks.

Paolo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-09-17  9:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-15  1:13 [Qemu-devel] [PATCH] SCSI disk, set HISUP bit in INQ data Ronnie Sahlberg
2012-09-15  1:13 ` [Qemu-devel] [PATCH] SCSI: Standard INQUIRY data should report HiSup flag as set Ronnie Sahlberg
2012-09-17  9:17   ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).