[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [PATCH] spapr-vscsi: Report error on unsupported MAD requ
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-ppc] [PATCH] spapr-vscsi: Report error on unsupported MAD requests |
Date: |
Mon, 26 Aug 2013 15:43:35 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8 |
Il 23/08/2013 11:23, Alexey Kardashevskiy ha scritto:
> The existing driver just dropped unsupported requests. This adds error
> responses to those unhandled requests.
>
> Signed-off-by: Alexey Kardashevskiy <address@hidden>
> ---
> hw/scsi/spapr_vscsi.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/hw/scsi/spapr_vscsi.c b/hw/scsi/spapr_vscsi.c
> index cc35b1b..9259d7e 100644
> --- a/hw/scsi/spapr_vscsi.c
> +++ b/hw/scsi/spapr_vscsi.c
> @@ -957,24 +957,24 @@ static int vscsi_handle_mad_req(VSCSIState *s,
> vscsi_req *req)
> break;
> case VIOSRP_ERROR_LOG_TYPE:
> fprintf(stderr, "Unsupported ERROR LOG MAD IU\n");
Please use error_report...
> - mad->error_log.common.status = cpu_to_be16(1);
> - vscsi_send_iu(s, req, sizeof(mad->error_log), VIOSRP_MAD_FORMAT);
> break;
> case VIOSRP_ADAPTER_INFO_TYPE:
> vscsi_send_adapter_info(s, req);
> - break;
> + return 1;
> case VIOSRP_HOST_CONFIG_TYPE:
> - mad->host_config.common.status = cpu_to_be16(1);
> - vscsi_send_iu(s, req, sizeof(mad->host_config), VIOSRP_MAD_FORMAT);
> + fprintf(stderr, "Unsupported HOST CONFIG TYPE MAD IU\n");
... especially in this new fprintf...
> break;
> case VIOSRP_CAPABILITIES_TYPE:
> vscsi_send_capabilities(s, req);
> - break;
> + return 1;
> default:
> fprintf(stderr, "VSCSI: Unknown MAD type %02x\n",
> be32_to_cpu(mad->empty_iu.common.type));
... and here too, please.
Thanks,
Paolo
> }
>
> + mad->empty_iu.common.status = cpu_to_be16(VIOSRP_MAD_NOT_SUPPORTED);
> + vscsi_send_iu(s, req, mad->empty_iu.common.length, VIOSRP_MAD_FORMAT);
> +
> return 1;
> }
>
>