From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55675) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VE7UN-0000LG-SV for qemu-devel@nongnu.org; Mon, 26 Aug 2013 20:50:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VE7UI-0007OM-SS for qemu-devel@nongnu.org; Mon, 26 Aug 2013 20:50:31 -0400 Message-ID: <1377564609.3819.90.camel@pasglop> From: Benjamin Herrenschmidt Date: Tue, 27 Aug 2013 10:50:09 +1000 In-Reply-To: <521B5B87.30901@redhat.com> References: <1377249797-12623-1-git-send-email-aik@ozlabs.ru> <521B5B87.30901@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] spapr-vscsi: Report error on unsupported MAD requests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Alexey Kardashevskiy , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Alexander Graf On Mon, 2013-08-26 at 15:43 +0200, Paolo Bonzini wrote: > 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 > > --- > > 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... So we have this discussion on IRC and I somewhat disagree.. Yes, this driver should be updated to use error_report. However, it currently doesn't and I think it should remain consistent. IE. This patch should use whatever the driver already uses and a separate patch should convert the whole thing to 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; > > } > > > >