diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2011-04-18 14:59:13 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2011-05-26 12:14:14 +0200 |
commit | ab9adc88c80186cfef29bda076363e20aa675241 (patch) | |
tree | 75899831e47ea90207dbbcbb291bd896ed420506 /hw/scsi-generic.c | |
parent | 40f16dd1279e7f26357b3c4b3838a89ffc6153da (diff) |
scsi: introduce scsi_req_data
This abstracts calling the command_complete callback, reducing churn
in the following patches.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'hw/scsi-generic.c')
-rw-r--r-- | hw/scsi-generic.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/scsi-generic.c b/hw/scsi-generic.c index 102f1dae09..e4f1f3079e 100644 --- a/hw/scsi-generic.c +++ b/hw/scsi-generic.c @@ -175,7 +175,7 @@ static void scsi_read_complete(void * opaque, int ret) if (len == 0) { scsi_command_complete(r, 0); } else { - r->req.bus->complete(r->req.bus, SCSI_REASON_DATA, r->req.tag, len); + scsi_req_data(&r->req, len); } } @@ -212,7 +212,7 @@ static void scsi_read_data(SCSIDevice *d, uint32_t tag) DPRINTF("Sense: %d %d %d %d %d %d %d %d\n", r->buf[0], r->buf[1], r->buf[2], r->buf[3], r->buf[4], r->buf[5], r->buf[6], r->buf[7]); - r->req.bus->complete(r->req.bus, SCSI_REASON_DATA, r->req.tag, s->senselen); + scsi_req_data(&r->req, s->senselen); return; } @@ -263,7 +263,7 @@ static int scsi_write_data(SCSIDevice *d, uint32_t tag) if (r->len == 0) { r->len = r->buflen; - r->req.bus->complete(r->req.bus, SCSI_REASON_DATA, r->req.tag, r->len); + scsi_req_data(&r->req, r->len); return 0; } |