aboutsummaryrefslogtreecommitdiff
path: root/hw/scsi-bus.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2011-04-18 15:28:11 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2011-05-26 12:14:16 +0200
commitad3376cc558f69606ac25ab6d597db71c969d8b6 (patch)
tree38da81601cf2cd632179134480d4c5d3aeaad09b /hw/scsi-bus.c
parent43a2b33957697347e4e6d00557221538231bfe4d (diff)
downloadqemu-ad3376cc558f69606ac25ab6d597db71c969d8b6.zip
qemu-ad3376cc558f69606ac25ab6d597db71c969d8b6.tar.gz
qemu-ad3376cc558f69606ac25ab6d597db71c969d8b6.tar.bz2
scsi: introduce scsi_req_continue
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Cc: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'hw/scsi-bus.c')
-rw-r--r--hw/scsi-bus.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c
index 6ac2650..fb96bde 100644
--- a/hw/scsi-bus.c
+++ b/hw/scsi-bus.c
@@ -602,11 +602,21 @@ void scsi_req_unref(SCSIRequest *req)
}
}
+/* Tell the device that we finished processing this chunk of I/O. It
+ will start the next chunk or complete the command. */
+void scsi_req_continue(SCSIRequest *req)
+{
+ trace_scsi_req_continue(req->dev->id, req->lun, req->tag);
+ if (req->cmd.mode == SCSI_XFER_TO_DEV) {
+ req->dev->info->write_data(req);
+ } else {
+ req->dev->info->read_data(req);
+ }
+}
+
/* Called by the devices when data is ready for the HBA. The HBA should
start a DMA operation to read or fill the device's data buffer.
- Once it completes, calling one of req->dev->info->read_data or
- req->dev->info->write_data (depending on the direction of the
- transfer) will restart I/O. */
+ Once it completes, calling scsi_req_continue will restart I/O. */
void scsi_req_data(SCSIRequest *req, int len)
{
trace_scsi_req_data(req->dev->id, req->lun, req->tag, len);