All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] hw/usb/dev-uas: Fix Clang 11 -Wgnu-variable-sized-type-not-at-end error
@ 2021-01-18 17:03 Philippe Mathieu-Daudé
  2021-01-18 17:03 ` [RFC PATCH 1/2] scsi/utils: Add INVALID_PARAM_VALUE sense code definition Philippe Mathieu-Daudé
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-01-18 17:03 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Paolo Bonzini, Philippe Mathieu-Daudé,
	Gerd Hoffmann, qemu-block

Another attempt to fix the following Clang 11 warning:

  usb/dev-uas.c:157:31: error: field 'status' with variable sized type 'uas_i=
u' not at the end of a struct or class is a GNU extension [-Werror,-Wgnu-vari=
able-sized-type-not-at-end]
      uas_iu                    status;
                                ^
If a guest send a packet with additional data, respond
with "Illegal Request - parameter not supported".

Philippe Mathieu-Daud=C3=A9 (2):
  scsi/utils: Add INVALID_PARAM_VALUE sense code definition
  hw/usb/dev-uas: Report command additional adb length as unsupported

 include/scsi/utils.h |  2 ++
 hw/usb/dev-uas.c     | 12 +++++++++++-
 scsi/utils.c         |  5 +++++
 3 files changed, 18 insertions(+), 1 deletion(-)

--=20
2.26.2




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

* [RFC PATCH 1/2] scsi/utils: Add INVALID_PARAM_VALUE sense code definition
  2021-01-18 17:03 [RFC PATCH 0/2] hw/usb/dev-uas: Fix Clang 11 -Wgnu-variable-sized-type-not-at-end error Philippe Mathieu-Daudé
@ 2021-01-18 17:03 ` Philippe Mathieu-Daudé
  2021-01-20 14:58   ` Eric Blake
  2021-01-18 17:03 ` [RFC PATCH 2/2] hw/usb/dev-uas: Report command additional adb length as unsupported Philippe Mathieu-Daudé
  2021-01-19 16:41 ` [RFC PATCH 0/2] hw/usb/dev-uas: Fix Clang 11 -Wgnu-variable-sized-type-not-at-end error Gerd Hoffmann
  2 siblings, 1 reply; 10+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-01-18 17:03 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Paolo Bonzini, Philippe Mathieu-Daudé,
	Gerd Hoffmann, qemu-block

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 include/scsi/utils.h | 2 ++
 scsi/utils.c         | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/include/scsi/utils.h b/include/scsi/utils.h
index fbc55882799..096489c6cd1 100644
--- a/include/scsi/utils.h
+++ b/include/scsi/utils.h
@@ -57,6 +57,8 @@ extern const struct SCSISense sense_code_LBA_OUT_OF_RANGE;
 extern const struct SCSISense sense_code_INVALID_FIELD;
 /* Illegal request, Invalid field in parameter list */
 extern const struct SCSISense sense_code_INVALID_PARAM;
+/* Illegal request, Invalid value in parameter list */
+extern const struct SCSISense sense_code_INVALID_PARAM_VALUE;
 /* Illegal request, Parameter list length error */
 extern const struct SCSISense sense_code_INVALID_PARAM_LEN;
 /* Illegal request, LUN not supported */
diff --git a/scsi/utils.c b/scsi/utils.c
index b37c2830148..793c3a6b9c9 100644
--- a/scsi/utils.c
+++ b/scsi/utils.c
@@ -197,6 +197,11 @@ const struct SCSISense sense_code_INVALID_PARAM = {
     .key = ILLEGAL_REQUEST, .asc = 0x26, .ascq = 0x00
 };
 
+/* Illegal request, Invalid value in parameter list */
+const struct SCSISense sense_code_INVALID_PARAM_VALUE = {
+    .key = ILLEGAL_REQUEST, .asc = 0x26, .ascq = 0x01
+};
+
 /* Illegal request, Parameter list length error */
 const struct SCSISense sense_code_INVALID_PARAM_LEN = {
     .key = ILLEGAL_REQUEST, .asc = 0x1a, .ascq = 0x00
-- 
2.26.2



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

* [RFC PATCH 2/2] hw/usb/dev-uas: Report command additional adb length as unsupported
  2021-01-18 17:03 [RFC PATCH 0/2] hw/usb/dev-uas: Fix Clang 11 -Wgnu-variable-sized-type-not-at-end error Philippe Mathieu-Daudé
  2021-01-18 17:03 ` [RFC PATCH 1/2] scsi/utils: Add INVALID_PARAM_VALUE sense code definition Philippe Mathieu-Daudé
@ 2021-01-18 17:03 ` Philippe Mathieu-Daudé
  2021-01-19 23:28   ` Philippe Mathieu-Daudé
  2021-01-20 14:11   ` Eric Blake
  2021-01-19 16:41 ` [RFC PATCH 0/2] hw/usb/dev-uas: Fix Clang 11 -Wgnu-variable-sized-type-not-at-end error Gerd Hoffmann
  2 siblings, 2 replies; 10+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-01-18 17:03 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Ed Maste, qemu-block, Gustavo A . R . Silva,
	Gerd Hoffmann, Marc-André Lureau, Paolo Bonzini,
	Philippe Mathieu-Daudé,
	Daniele Buono, Han Han

We are not ready to handle additional CDB data.

If a guest send a packet with such additional data,
report the command parameter as not supported.

We can then explicit there is nothing in this additional
buffer, by fixing its size to zero.

This fixes an error when building with Clang 11:

  usb/dev-uas.c:157:31: error: field 'status' with variable sized type 'uas_iu' not at the end of a struct or class is a GNU extension [-Werror,-Wgnu-variable-sized-type-not-at-end]
      uas_iu                    status;
                                ^

Reported-by: Daniele Buono <dbuono@linux.vnet.ibm.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
Cc: Ed Maste <emaste@FreeBSD.org>
Cc: Han Han <hhan@redhat.com>
Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 hw/usb/dev-uas.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/hw/usb/dev-uas.c b/hw/usb/dev-uas.c
index cec071d96c4..b6434ad4b9c 100644
--- a/hw/usb/dev-uas.c
+++ b/hw/usb/dev-uas.c
@@ -16,6 +16,7 @@
 #include "qemu/error-report.h"
 #include "qemu/main-loop.h"
 #include "qemu/module.h"
+#include "qemu/log.h"
 
 #include "hw/usb.h"
 #include "migration/vmstate.h"
@@ -70,7 +71,7 @@ typedef struct {
     uint8_t    reserved_2;
     uint64_t   lun;
     uint8_t    cdb[16];
-    uint8_t    add_cdb[];
+    uint8_t    add_cdb[0];      /* not supported by QEMU */
 } QEMU_PACKED  uas_iu_command;
 
 typedef struct {
@@ -700,6 +701,11 @@ static void usb_uas_command(UASDevice *uas, uas_iu *iu)
     uint32_t len;
     uint16_t tag = be16_to_cpu(iu->hdr.tag);
 
+    if (iu->command.add_cdb_length > 0) {
+        qemu_log_mask(LOG_UNIMP, "additional adb length not yet supported\n");
+        goto unsupported_len;
+    }
+
     if (uas_using_streams(uas) && tag > UAS_MAX_STREAMS) {
         goto invalid_tag;
     }
@@ -735,6 +741,10 @@ static void usb_uas_command(UASDevice *uas, uas_iu *iu)
     }
     return;
 
+unsupported_len:
+    usb_uas_queue_fake_sense(uas, tag, sense_code_INVALID_PARAM_VALUE);
+    return;
+
 invalid_tag:
     usb_uas_queue_fake_sense(uas, tag, sense_code_INVALID_TAG);
     return;
-- 
2.26.2



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

* Re: [RFC PATCH 0/2] hw/usb/dev-uas: Fix Clang 11 -Wgnu-variable-sized-type-not-at-end error
  2021-01-18 17:03 [RFC PATCH 0/2] hw/usb/dev-uas: Fix Clang 11 -Wgnu-variable-sized-type-not-at-end error Philippe Mathieu-Daudé
  2021-01-18 17:03 ` [RFC PATCH 1/2] scsi/utils: Add INVALID_PARAM_VALUE sense code definition Philippe Mathieu-Daudé
  2021-01-18 17:03 ` [RFC PATCH 2/2] hw/usb/dev-uas: Report command additional adb length as unsupported Philippe Mathieu-Daudé
@ 2021-01-19 16:41 ` Gerd Hoffmann
  2021-01-19 16:49   ` Philippe Mathieu-Daudé
  2 siblings, 1 reply; 10+ messages in thread
From: Gerd Hoffmann @ 2021-01-19 16:41 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Paolo Bonzini, qemu-devel, qemu-block

On Mon, Jan 18, 2021 at 06:03:06PM +0100, Philippe Mathieu-Daudé wrote:
> Another attempt to fix the following Clang 11 warning:
> 
>   usb/dev-uas.c:157:31: error: field 'status' with variable sized type 'uas_i=
> u' not at the end of a struct or class is a GNU extension [-Werror,-Wgnu-vari=
> able-sized-type-not-at-end]
>       uas_iu                    status;
>                                 ^
> If a guest send a packet with additional data, respond
> with "Illegal Request - parameter not supported".

Why rfc?  looks good to me as-is ;)

thanks,
  Gerd



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

* Re: [RFC PATCH 0/2] hw/usb/dev-uas: Fix Clang 11 -Wgnu-variable-sized-type-not-at-end error
  2021-01-19 16:41 ` [RFC PATCH 0/2] hw/usb/dev-uas: Fix Clang 11 -Wgnu-variable-sized-type-not-at-end error Gerd Hoffmann
@ 2021-01-19 16:49   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 10+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-01-19 16:49 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: Fam Zheng, Paolo Bonzini, qemu-devel, qemu-block

On 1/19/21 5:41 PM, Gerd Hoffmann wrote:
> On Mon, Jan 18, 2021 at 06:03:06PM +0100, Philippe Mathieu-Daudé wrote:
>> Another attempt to fix the following Clang 11 warning:
>>
>>   usb/dev-uas.c:157:31: error: field 'status' with variable sized type 'uas_i=
>> u' not at the end of a struct or class is a GNU extension [-Werror,-Wgnu-vari=
>> able-sized-type-not-at-end]
>>       uas_iu                    status;
>>                                 ^
>> If a guest send a packet with additional data, respond
>> with "Illegal Request - parameter not supported".
> 
> Why rfc?  looks good to me as-is ;)

Sorry I forgot to explain. RFC because I don't know enough SCSI
to be sure than the device returning sense_code_INVALID_PARAM_VALUE
on the bus is appropriate. This is the best fit I could find.

> 
> thanks,
>   Gerd
> 



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

* Re: [RFC PATCH 2/2] hw/usb/dev-uas: Report command additional adb length as unsupported
  2021-01-18 17:03 ` [RFC PATCH 2/2] hw/usb/dev-uas: Report command additional adb length as unsupported Philippe Mathieu-Daudé
@ 2021-01-19 23:28   ` Philippe Mathieu-Daudé
  2021-01-20 14:11   ` Eric Blake
  1 sibling, 0 replies; 10+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-01-19 23:28 UTC (permalink / raw)
  To: qemu-devel, Gerd Hoffmann
  Cc: Fam Zheng, Ed Maste, qemu-block, Gustavo A . R . Silva, Han Han,
	Marc-André Lureau, Paolo Bonzini, Daniele Buono

On 1/18/21 6:03 PM, Philippe Mathieu-Daudé wrote:
> We are not ready to handle additional CDB data.
> 
> If a guest send a packet with such additional data,
> report the command parameter as not supported.
> 
> We can then explicit there is nothing in this additional
> buffer, by fixing its size to zero.
> 
> This fixes an error when building with Clang 11:
> 
>   usb/dev-uas.c:157:31: error: field 'status' with variable sized type 'uas_iu' not at the end of a struct or class is a GNU extension [-Werror,-Wgnu-variable-sized-type-not-at-end]
>       uas_iu                    status;
>                                 ^
> 
> Reported-by: Daniele Buono <dbuono@linux.vnet.ibm.com>

TBH this should be (chronological order):
Reported-by: Ed Maste <emaste@FreeBSD.org>
Reported-by: Daniele Buono <dbuono@linux.vnet.ibm.com>
Reported-by: Han Han <hhan@redhat.com>

> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> Cc: Ed Maste <emaste@FreeBSD.org>
> Cc: Han Han <hhan@redhat.com>
> Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
>  hw/usb/dev-uas.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/usb/dev-uas.c b/hw/usb/dev-uas.c
> index cec071d96c4..b6434ad4b9c 100644
> --- a/hw/usb/dev-uas.c
> +++ b/hw/usb/dev-uas.c
> @@ -16,6 +16,7 @@
>  #include "qemu/error-report.h"
>  #include "qemu/main-loop.h"
>  #include "qemu/module.h"
> +#include "qemu/log.h"
>  
>  #include "hw/usb.h"
>  #include "migration/vmstate.h"
> @@ -70,7 +71,7 @@ typedef struct {
>      uint8_t    reserved_2;
>      uint64_t   lun;
>      uint8_t    cdb[16];
> -    uint8_t    add_cdb[];
> +    uint8_t    add_cdb[0];      /* not supported by QEMU */
>  } QEMU_PACKED  uas_iu_command;
>  
>  typedef struct {
> @@ -700,6 +701,11 @@ static void usb_uas_command(UASDevice *uas, uas_iu *iu)
>      uint32_t len;
>      uint16_t tag = be16_to_cpu(iu->hdr.tag);
>  
> +    if (iu->command.add_cdb_length > 0) {
> +        qemu_log_mask(LOG_UNIMP, "additional adb length not yet supported\n");
> +        goto unsupported_len;
> +    }
> +
>      if (uas_using_streams(uas) && tag > UAS_MAX_STREAMS) {
>          goto invalid_tag;
>      }
> @@ -735,6 +741,10 @@ static void usb_uas_command(UASDevice *uas, uas_iu *iu)
>      }
>      return;
>  
> +unsupported_len:
> +    usb_uas_queue_fake_sense(uas, tag, sense_code_INVALID_PARAM_VALUE);
> +    return;
> +
>  invalid_tag:
>      usb_uas_queue_fake_sense(uas, tag, sense_code_INVALID_TAG);
>      return;
> 



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

* Re: [RFC PATCH 2/2] hw/usb/dev-uas: Report command additional adb length as unsupported
  2021-01-18 17:03 ` [RFC PATCH 2/2] hw/usb/dev-uas: Report command additional adb length as unsupported Philippe Mathieu-Daudé
  2021-01-19 23:28   ` Philippe Mathieu-Daudé
@ 2021-01-20 14:11   ` Eric Blake
  1 sibling, 0 replies; 10+ messages in thread
From: Eric Blake @ 2021-01-20 14:11 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Fam Zheng, Ed Maste, qemu-block, Gustavo A . R . Silva,
	Gerd Hoffmann, Paolo Bonzini, Marc-André Lureau,
	Daniele Buono, Han Han

On 1/18/21 11:03 AM, Philippe Mathieu-Daudé wrote:
> We are not ready to handle additional CDB data.
> 
> If a guest send a packet with such additional data,

sends

> report the command parameter as not supported.
> 
> We can then explicit there is nothing in this additional

then be explicit that there

> buffer, by fixing its size to zero.
> 
> This fixes an error when building with Clang 11:
> 
>   usb/dev-uas.c:157:31: error: field 'status' with variable sized type 'uas_iu' not at the end of a struct or class is a GNU extension [-Werror,-Wgnu-variable-sized-type-not-at-end]
>       uas_iu                    status;
>                                 ^
> 
> Reported-by: Daniele Buono <dbuono@linux.vnet.ibm.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> Cc: Ed Maste <emaste@FreeBSD.org>
> Cc: Han Han <hhan@redhat.com>
> Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
>  hw/usb/dev-uas.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/usb/dev-uas.c b/hw/usb/dev-uas.c
> index cec071d96c4..b6434ad4b9c 100644
> --- a/hw/usb/dev-uas.c
> +++ b/hw/usb/dev-uas.c
> @@ -16,6 +16,7 @@
>  #include "qemu/error-report.h"
>  #include "qemu/main-loop.h"
>  #include "qemu/module.h"
> +#include "qemu/log.h"
>  
>  #include "hw/usb.h"
>  #include "migration/vmstate.h"
> @@ -70,7 +71,7 @@ typedef struct {
>      uint8_t    reserved_2;
>      uint64_t   lun;
>      uint8_t    cdb[16];
> -    uint8_t    add_cdb[];
> +    uint8_t    add_cdb[0];      /* not supported by QEMU */
>  } QEMU_PACKED  uas_iu_command;

Technically, a zero-sized array is also a gcc/clang extension, and may
bite us later if that extension starts triggering compiler complaints in
one of the two compilers, just as our current use of an extension is
causing grief in clang 11.  But in the short term, it works, and gets
rid of the more problematic extension of a dynamically-sized type
preventing the determination of a packed union containing that type.

>  
>  typedef struct {
> @@ -700,6 +701,11 @@ static void usb_uas_command(UASDevice *uas, uas_iu *iu)
>      uint32_t len;
>      uint16_t tag = be16_to_cpu(iu->hdr.tag);
>  
> +    if (iu->command.add_cdb_length > 0) {
> +        qemu_log_mask(LOG_UNIMP, "additional adb length not yet supported\n");
> +        goto unsupported_len;
> +    }
> +
>      if (uas_using_streams(uas) && tag > UAS_MAX_STREAMS) {
>          goto invalid_tag;
>      }
> @@ -735,6 +741,10 @@ static void usb_uas_command(UASDevice *uas, uas_iu *iu)
>      }
>      return;
>  
> +unsupported_len:
> +    usb_uas_queue_fake_sense(uas, tag, sense_code_INVALID_PARAM_VALUE);
> +    return;
> +
>  invalid_tag:
>      usb_uas_queue_fake_sense(uas, tag, sense_code_INVALID_TAG);
>      return;
> 

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org



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

* Re: [RFC PATCH 1/2] scsi/utils: Add INVALID_PARAM_VALUE sense code definition
  2021-01-18 17:03 ` [RFC PATCH 1/2] scsi/utils: Add INVALID_PARAM_VALUE sense code definition Philippe Mathieu-Daudé
@ 2021-01-20 14:58   ` Eric Blake
  2021-01-20 16:01     ` Gerd Hoffmann
  0 siblings, 1 reply; 10+ messages in thread
From: Eric Blake @ 2021-01-20 14:58 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Fam Zheng, Paolo Bonzini, Gerd Hoffmann, qemu-block

On 1/18/21 11:03 AM, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  include/scsi/utils.h | 2 ++
>  scsi/utils.c         | 5 +++++
>  2 files changed, 7 insertions(+)
> 
> diff --git a/include/scsi/utils.h b/include/scsi/utils.h
> index fbc55882799..096489c6cd1 100644
> --- a/include/scsi/utils.h
> +++ b/include/scsi/utils.h
> @@ -57,6 +57,8 @@ extern const struct SCSISense sense_code_LBA_OUT_OF_RANGE;
>  extern const struct SCSISense sense_code_INVALID_FIELD;
>  /* Illegal request, Invalid field in parameter list */
>  extern const struct SCSISense sense_code_INVALID_PARAM;
> +/* Illegal request, Invalid value in parameter list */
> +extern const struct SCSISense sense_code_INVALID_PARAM_VALUE;
>  /* Illegal request, Parameter list length error */
>  extern const struct SCSISense sense_code_INVALID_PARAM_LEN;
>  /* Illegal request, LUN not supported */

Pre-existing: the term 'illegal' is suspect in computer science (the
code isn't breaking any laws); I prefer 'invalid'.  But that's a pet
peeve of mine, and not something you need to change here.

> diff --git a/scsi/utils.c b/scsi/utils.c
> index b37c2830148..793c3a6b9c9 100644
> --- a/scsi/utils.c
> +++ b/scsi/utils.c
> @@ -197,6 +197,11 @@ const struct SCSISense sense_code_INVALID_PARAM = {
>      .key = ILLEGAL_REQUEST, .asc = 0x26, .ascq = 0x00
>  };
>  
> +/* Illegal request, Invalid value in parameter list */
> +const struct SCSISense sense_code_INVALID_PARAM_VALUE = {
> +    .key = ILLEGAL_REQUEST, .asc = 0x26, .ascq = 0x01
> +};
> +
>  /* Illegal request, Parameter list length error */
>  const struct SCSISense sense_code_INVALID_PARAM_LEN = {
>      .key = ILLEGAL_REQUEST, .asc = 0x1a, .ascq = 0x00
> 

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org



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

* Re: [RFC PATCH 1/2] scsi/utils: Add INVALID_PARAM_VALUE sense code definition
  2021-01-20 14:58   ` Eric Blake
@ 2021-01-20 16:01     ` Gerd Hoffmann
  2021-01-20 16:04       ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 10+ messages in thread
From: Gerd Hoffmann @ 2021-01-20 16:01 UTC (permalink / raw)
  To: Eric Blake
  Cc: Fam Zheng, Paolo Bonzini, Philippe Mathieu-Daudé,
	qemu-devel, qemu-block

  Hi,

> > +/* Illegal request, Invalid value in parameter list */
> > +extern const struct SCSISense sense_code_INVALID_PARAM_VALUE;

> Pre-existing: the term 'illegal' is suspect in computer science (the
> code isn't breaking any laws);

Indeed.  It's named that way in the scsi specs though, and being
consistent with that is a reasonable thing too ...

take care,
  Gerd



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

* Re: [RFC PATCH 1/2] scsi/utils: Add INVALID_PARAM_VALUE sense code definition
  2021-01-20 16:01     ` Gerd Hoffmann
@ 2021-01-20 16:04       ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 10+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-01-20 16:04 UTC (permalink / raw)
  To: Gerd Hoffmann, Eric Blake
  Cc: Fam Zheng, Paolo Bonzini, qemu-devel, qemu-block

On 1/20/21 5:01 PM, Gerd Hoffmann wrote:
>   Hi,
> 
>>> +/* Illegal request, Invalid value in parameter list */
>>> +extern const struct SCSISense sense_code_INVALID_PARAM_VALUE;
> 
>> Pre-existing: the term 'illegal' is suspect in computer science (the
>> code isn't breaking any laws);
> 
> Indeed.  It's named that way in the scsi specs though, and being
> consistent with that is a reasonable thing too ...

In v2 I renamed 'illegal' in the description comments but
not in the #definitions (which match the specs).

Regards,

Phil.



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

end of thread, other threads:[~2021-01-20 16:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-18 17:03 [RFC PATCH 0/2] hw/usb/dev-uas: Fix Clang 11 -Wgnu-variable-sized-type-not-at-end error Philippe Mathieu-Daudé
2021-01-18 17:03 ` [RFC PATCH 1/2] scsi/utils: Add INVALID_PARAM_VALUE sense code definition Philippe Mathieu-Daudé
2021-01-20 14:58   ` Eric Blake
2021-01-20 16:01     ` Gerd Hoffmann
2021-01-20 16:04       ` Philippe Mathieu-Daudé
2021-01-18 17:03 ` [RFC PATCH 2/2] hw/usb/dev-uas: Report command additional adb length as unsupported Philippe Mathieu-Daudé
2021-01-19 23:28   ` Philippe Mathieu-Daudé
2021-01-20 14:11   ` Eric Blake
2021-01-19 16:41 ` [RFC PATCH 0/2] hw/usb/dev-uas: Fix Clang 11 -Wgnu-variable-sized-type-not-at-end error Gerd Hoffmann
2021-01-19 16:49   ` Philippe Mathieu-Daudé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.