Revision a0e66a69

b/hw/scsi-disk.c
55 55
    uint64_t sector;
56 56
    uint32_t sector_count;
57 57
    uint32_t buflen;
58
    bool started;
58 59
    struct iovec iov;
59 60
    QEMUIOVector qiov;
60 61
    BlockAcctCookie acct;
......
287 288
    if (r->sector_count == (uint32_t)-1) {
288 289
        DPRINTF("Read buf_len=%zd\n", r->iov.iov_len);
289 290
        r->sector_count = 0;
291
        r->started = true;
290 292
        scsi_req_data(&r->req, r->iov.iov_len);
291 293
        return;
292 294
    }
......
313 315
        return;
314 316
    }
315 317

  
318
    r->started = true;
316 319
    if (r->req.sg) {
317 320
        dma_acct_start(s->qdev.conf.bs, &r->acct, r->req.sg, BDRV_ACCT_READ);
318 321
        r->req.resid -= r->req.sg->size;
......
425 428

  
426 429
    if (!r->req.sg && !r->qiov.size) {
427 430
        /* Called for the first time.  Ask the driver to send us more data.  */
431
        r->started = true;
428 432
        scsi_write_complete(r, 0);
429 433
        return;
430 434
    }

Also available in: Unified diff