qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
	Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] [PATCH] spapr-vscsi: Report error on unsupported MAD requests
Date: Mon, 26 Aug 2013 15:43:35 +0200	[thread overview]
Message-ID: <521B5B87.30901@redhat.com> (raw)
In-Reply-To: <1377249797-12623-1-git-send-email-aik@ozlabs.ru>

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 <aik@ozlabs.ru>
> ---
>  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;
>  }
>  
> 

  parent reply	other threads:[~2013-08-26 13:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-23  9:23 [Qemu-devel] [PATCH] spapr-vscsi: Report error on unsupported MAD requests Alexey Kardashevskiy
2013-08-25 16:26 ` Alexander Graf
2013-08-26 13:43 ` Paolo Bonzini [this message]
2013-08-27  0:50   ` Benjamin Herrenschmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=521B5B87.30901@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).