From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:39766) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGVxq-000573-RE for qemu-devel@nongnu.org; Wed, 19 Oct 2011 09:13:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RGVxp-0004Y4-A1 for qemu-devel@nongnu.org; Wed, 19 Oct 2011 09:13:46 -0400 Received: from mail-qw0-f45.google.com ([209.85.216.45]:57696) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGVxp-0004Xj-4K for qemu-devel@nongnu.org; Wed, 19 Oct 2011 09:13:45 -0400 Received: by qadc12 with SMTP id c12so573979qad.4 for ; Wed, 19 Oct 2011 06:13:44 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4E9ECD00.6070103@redhat.com> Date: Wed, 19 Oct 2011 15:13:36 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1318503845-11473-1-git-send-email-pbonzini@redhat.com> <1318503845-11473-21-git-send-email-pbonzini@redhat.com> In-Reply-To: <1318503845-11473-21-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 20/35] scsi-disk: do not complete requests twice List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On 10/13/2011 01:03 PM, Paolo Bonzini wrote: > When scsi_handle_rw_error reports a CHECK CONDITION code, the > owner should not call scsi_req_complete. > > Signed-off-by: Paolo Bonzini > --- > hw/scsi-disk.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c > index b041fd5..d4f773f 100644 > --- a/hw/scsi-disk.c > +++ b/hw/scsi-disk.c > @@ -231,6 +231,7 @@ static int scsi_handle_rw_error(SCSIDiskReq *r, int error, int type) > bdrv_mon_event(s->bs, BDRV_ACTION_STOP, is_read); > vm_stop(RUN_STATE_IO_ERROR); > bdrv_iostatus_set_err(s->bs, error); > + return 1; > } else { > switch (error) { > case ENOMEDIUM: > @@ -247,8 +248,8 @@ static int scsi_handle_rw_error(SCSIDiskReq *r, int error, int type) > break; > } > bdrv_mon_event(s->bs, BDRV_ACTION_REPORT, is_read); > + return 0; > } > - return 1; > } > > static void scsi_write_complete(void * opaque, int ret) Kevin mentioned on IRC that this patch is bogus, and I agreed. Paolo