From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46657) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VDvGe-0000hF-1S for qemu-devel@nongnu.org; Mon, 26 Aug 2013 07:47:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VDvGR-0000MA-Pn for qemu-devel@nongnu.org; Mon, 26 Aug 2013 07:47:31 -0400 Received: from e23smtp03.au.ibm.com ([202.81.31.145]:51828) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VDvGR-0000La-4d for qemu-devel@nongnu.org; Mon, 26 Aug 2013 07:47:19 -0400 Received: from /spool/local by e23smtp03.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 26 Aug 2013 21:36:05 +1000 From: Nikunj A Dadhania In-Reply-To: <011735F8-0ED7-40CF-A23A-CE34C21F1D3C@suse.de> References: <1377249737-12570-1-git-send-email-aik@ozlabs.ru> <24C2B209-2082-4AF8-A8FB-1FF8A8B7751B@suse.de> <1377468637.3819.27.camel@pasglop> <87vc2tysur.fsf@linux.vnet.ibm.com> <874naczpk5.fsf@linux.vnet.ibm.com> <011735F8-0ED7-40CF-A23A-CE34C21F1D3C@suse.de> Date: Mon, 26 Aug 2013 17:16:49 +0530 Message-ID: <87wqn8y8ra.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] spapr-vscsi: Adding VSCSI capabilities List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Alexey Kardashevskiy , Paolo Bonzini , "qemu-ppc@nongnu.org" , "qemu-devel@nongnu.org" Alexander Graf writes: > On 26.08.2013, at 12:58, Nikunj A Dadhania wrote: > >> This implements capabilities exchange between host and client. >> As at the moment no capability is supported, put zero flags everywhere >> and return. >> >> Signed-off-by: Nikunj A Dadhania >> --- >> + rc = spapr_vio_dma_read(&s->vdev, buffer, &cap, len); >> + if (rc) { >> + fprintf(stderr, "vscsi_send_capabilities: DMA read failure !\n"); > > At this point cap contains random host data, no? Yes, and we zero it out in this case. > >> + } >> + >> + /* >> + * Current implementation does not suppport any migration or >> + * reservation capabilities. Construct the response telling the >> + * guest not to use them. >> + */ >> + cap.flags = 0; >> + cap.migration.ecl = 0; >> + cap.reserve.type = 0; >> + cap.migration.common.server_support = 0; >> + cap.reserve.common.server_support = 0; >> + >> + rc = spapr_vio_dma_write(&s->vdev, buffer, &cap, len); >> + if (rc) { >> + fprintf(stderr, "vscsi_send_capabilities: DMA write failure !\n"); >> + } >> +error_out: > > This is just "out" rather than "error_out", no? We also get here when we don't hit an error. Yes, the label is more readable at the goto, where we set the error return code. In case of no error return code is H_SUCCESS. So that we send a response back to the guest. Regards Nikunj