scsi-disk: fix retrying a flush

Flush does not go anymore through scsi_disk_emulate_command.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Paolo Bonzini 2011-10-04 15:36:05 +02:00 committed by Kevin Wolf
parent 7cec78b6f0
commit 628e95b616
1 changed files with 3 additions and 6 deletions

View File

@ -81,7 +81,7 @@ struct SCSIDiskState
}; };
static int scsi_handle_rw_error(SCSIDiskReq *r, int error, int type); static int scsi_handle_rw_error(SCSIDiskReq *r, int error, int type);
static int scsi_disk_emulate_command(SCSIDiskReq *r); static int32_t scsi_send_command(SCSIRequest *req, uint8_t *buf);
static void scsi_free_request(SCSIRequest *req) static void scsi_free_request(SCSIRequest *req)
{ {
@ -325,7 +325,6 @@ static void scsi_dma_restart_bh(void *opaque)
r = DO_UPCAST(SCSIDiskReq, req, req); r = DO_UPCAST(SCSIDiskReq, req, req);
if (r->status & SCSI_REQ_STATUS_RETRY) { if (r->status & SCSI_REQ_STATUS_RETRY) {
int status = r->status; int status = r->status;
int ret;
r->status &= r->status &=
~(SCSI_REQ_STATUS_RETRY | SCSI_REQ_STATUS_RETRY_TYPE_MASK); ~(SCSI_REQ_STATUS_RETRY | SCSI_REQ_STATUS_RETRY_TYPE_MASK);
@ -338,10 +337,8 @@ static void scsi_dma_restart_bh(void *opaque)
scsi_write_data(&r->req); scsi_write_data(&r->req);
break; break;
case SCSI_REQ_STATUS_RETRY_FLUSH: case SCSI_REQ_STATUS_RETRY_FLUSH:
ret = scsi_disk_emulate_command(r); scsi_send_command(&r->req, r->req.cmd.buf);
if (ret == 0) { break;
scsi_req_complete(&r->req, GOOD);
}
} }
} }
} }