aboutsummaryrefslogtreecommitdiff
path: root/hw/scsi.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2011-07-06 11:55:37 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2012-02-22 13:29:07 +0100
commit01e95455889780871374e1b72cd6919cfbd23399 (patch)
tree402da6c430ccf8c2e8169201c920631786d69386 /hw/scsi.h
parentda2213275237a35d1e063db7d6d820905e7d4084 (diff)
scsi: pass residual amount to command_complete
With the upcoming sglist support, HBAs will not see any transfer_data call and will not have a way to detect short transfers. So pass the residual amount of data upon command completion. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/scsi.h')
-rw-r--r--hw/scsi.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/scsi.h b/hw/scsi.h
index dc72b6fc1e..8722ef9be4 100644
--- a/hw/scsi.h
+++ b/hw/scsi.h
@@ -46,6 +46,7 @@ struct SCSIRequest {
uint32_t tag;
uint32_t lun;
uint32_t status;
+ size_t resid;
SCSICommand cmd;
BlockDriverAIOCB *aiocb;
uint8_t sense[SCSI_SENSE_BUF_SIZE];
@@ -112,7 +113,7 @@ struct SCSIBusInfo {
int tcq;
int max_channel, max_target, max_lun;
void (*transfer_data)(SCSIRequest *req, uint32_t arg);
- void (*complete)(SCSIRequest *req, uint32_t arg);
+ void (*complete)(SCSIRequest *req, uint32_t arg, size_t resid);
void (*cancel)(SCSIRequest *req);
};