Patchwork [v3,11/21] scsi: use scsi_req_complete

login
register
mail settings
Submitter Paolo Bonzini
Date May 17, 2011, 11 a.m.
Message ID <1305630067-2119-12-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/95914/
State New
Headers show

Comments

Paolo Bonzini - May 17, 2011, 11 a.m.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/scsi-generic.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
Christoph Hellwig - May 20, 2011, 4:01 p.m.
Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

Patch

diff --git a/hw/scsi-generic.c b/hw/scsi-generic.c
index 5bfbb8a..e1f8a8a 100644
--- a/hw/scsi-generic.c
+++ b/hw/scsi-generic.c
@@ -288,7 +288,6 @@  static int32_t scsi_send_command(SCSIRequest *req, uint8_t *cmd)
 {
     SCSIGenericState *s = DO_UPCAST(SCSIGenericState, qdev, req->dev);
     SCSIGenericReq *r = DO_UPCAST(SCSIGenericReq, req, req);
-    SCSIBus *bus;
     int ret;
 
     scsi_req_enqueue(req);
@@ -305,8 +304,8 @@  static int32_t scsi_send_command(SCSIRequest *req, uint8_t *cmd)
         s->sensebuf[6] = 0x00;
         s->senselen = 7;
         s->driver_status = SG_ERR_DRIVER_SENSE;
-        bus = scsi_bus_from_device(&s->qdev);
-        bus->ops.complete(req, SCSI_REASON_DONE, CHECK_CONDITION);
+        r->req.status = CHECK_CONDITION;
+        scsi_req_complete(&r->req);
         return 0;
     }