qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 20/35] scsi-disk: do not complete requests twice


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 20/35] scsi-disk: do not complete requests twice
Date: Wed, 19 Oct 2011 15:13:36 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20110927 Thunderbird/7.0

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<address@hidden>
---
  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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]