diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2012-04-19 11:51:42 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2012-04-19 16:16:05 +0200 |
commit | a0e66a699e41f27cd70833045a71ddc52801dbb3 (patch) | |
tree | d48a87167c06aa7397ad88c8a9c5395e50ebc84b /hw/scsi-disk.c | |
parent | 7f64f8e2c3c5a02636c2a6b8d6e6c5f7a62b89f7 (diff) |
scsi: add a started field to SCSIDiskReq
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/scsi-disk.c')
-rw-r--r-- | hw/scsi-disk.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index 09c2715aec..428d83132f 100644 --- a/hw/scsi-disk.c +++ b/hw/scsi-disk.c @@ -55,6 +55,7 @@ typedef struct SCSIDiskReq { uint64_t sector; uint32_t sector_count; uint32_t buflen; + bool started; struct iovec iov; QEMUIOVector qiov; BlockAcctCookie acct; @@ -287,6 +288,7 @@ static void scsi_read_data(SCSIRequest *req) if (r->sector_count == (uint32_t)-1) { DPRINTF("Read buf_len=%zd\n", r->iov.iov_len); r->sector_count = 0; + r->started = true; scsi_req_data(&r->req, r->iov.iov_len); return; } @@ -313,6 +315,7 @@ static void scsi_read_data(SCSIRequest *req) return; } + r->started = true; if (r->req.sg) { dma_acct_start(s->qdev.conf.bs, &r->acct, r->req.sg, BDRV_ACCT_READ); r->req.resid -= r->req.sg->size; @@ -425,6 +428,7 @@ static void scsi_write_data(SCSIRequest *req) if (!r->req.sg && !r->qiov.size) { /* Called for the first time. Ask the driver to send us more data. */ + r->started = true; scsi_write_complete(r, 0); return; } |