static void scsi_read_request(SCSIDiskReq *r)

{

    SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev);

    uint32_t n;



    if (r->sector_count == (uint32_t)-1) {

        DPRINTF("Read buf_len=%zd\n", r->iov.iov_len);

        r->sector_count = 0;

        scsi_req_data(&r->req, r->iov.iov_len);

        return;

    }

    DPRINTF("Read sector_count=%d\n", r->sector_count);

    if (r->sector_count == 0) {

        scsi_command_complete(r, GOOD, NO_SENSE);

        return;

    }



    /* No data transfer may already be in progress */

    assert(r->req.aiocb == NULL);



    n = r->sector_count;

    if (n > SCSI_DMA_BUF_SIZE / 512)

        n = SCSI_DMA_BUF_SIZE / 512;



    r->iov.iov_len = n * 512;

    qemu_iovec_init_external(&r->qiov, &r->iov, 1);

    r->req.aiocb = bdrv_aio_readv(s->bs, r->sector, &r->qiov, n,

                              scsi_read_complete, r);

    if (r->req.aiocb == NULL) {

        scsi_read_complete(r, -EIO);

    }

}

static void scsi_read_request(SCSIDiskReq *r)

{

    SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev);

    uint32_t n;



    if (r->sector_count == (uint32_t)-1) {

        DPRINTF("Read buf_len=%zd\n", r->iov.iov_len);

        r->sector_count = 0;

        scsi_req_data(&r->req, r->iov.iov_len);

        return;

    }

    DPRINTF("Read sector_count=%d\n", r->sector_count);

    if (r->sector_count == 0) {

        scsi_command_complete(r, GOOD, NO_SENSE);

        return;

    }



    

    assert(r->req.aiocb == NULL);



    n = r->sector_count;

    if (n > SCSI_DMA_BUF_SIZE / 512)

        n = SCSI_DMA_BUF_SIZE / 512;



    r->iov.iov_len = n * 512;

    qemu_iovec_init_external(&r->qiov, &r->iov, 1);

    r->req.aiocb = bdrv_aio_readv(s->bs, r->sector, &r->qiov, n,

                              scsi_read_complete, r);

    if (r->req.aiocb == NULL) {

        scsi_read_complete(r, -EIO);

    }

}

static void scsi_read_request(SCSIDiskReq *r)
static void FUNC_0(SCSIDiskReq *VAR_0)

{

    SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, VAR_0->req.dev);

    uint32_t n;



    if (VAR_0->sector_count == (uint32_t)-1) {

        DPRINTF("Read buf_len=%zd\n", VAR_0->iov.iov_len);

        VAR_0->sector_count = 0;

        scsi_req_data(&VAR_0->req, VAR_0->iov.iov_len);

        return;

    }

    DPRINTF("Read sector_count=%d\n", VAR_0->sector_count);

    if (VAR_0->sector_count == 0) {

        scsi_command_complete(VAR_0, GOOD, NO_SENSE);

        return;

    }



    

    assert(VAR_0->req.aiocb == NULL);



    n = VAR_0->sector_count;

    if (n > SCSI_DMA_BUF_SIZE / 512)

        n = SCSI_DMA_BUF_SIZE / 512;



    VAR_0->iov.iov_len = n * 512;

    qemu_iovec_init_external(&VAR_0->qiov, &VAR_0->iov, 1);

    VAR_0->req.aiocb = bdrv_aio_readv(s->bs, VAR_0->sector, &VAR_0->qiov, n,

                              scsi_read_complete, VAR_0);

    if (VAR_0->req.aiocb == NULL) {

        scsi_read_complete(VAR_0, -EIO);

    }

}

static void FUNC_0(SCSIDiskReq *VAR_0)
{ SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, VAR_0->req.dev); uint32_t n; if (VAR_0->sector_count == (uint32_t)-1) { DPRINTF("Read buf_len=%zd\n", VAR_0->iov.iov_len); VAR_0->sector_count = 0; scsi_req_data(&VAR_0->req, VAR_0->iov.iov_len); return; } DPRINTF("Read sector_count=%d\n", VAR_0->sector_count); if (VAR_0->sector_count == 0) { scsi_command_complete(VAR_0, GOOD, NO_SENSE); return; } assert(VAR_0->req.aiocb == NULL); n = VAR_0->sector_count; if (n > SCSI_DMA_BUF_SIZE / 512)
n = SCSI_DMA_BUF_SIZE / 512; VAR_0->iov.iov_len = n * 512; qemu_iovec_init_external(&VAR_0->qiov, &VAR_0->iov, 1); VAR_0->req.aiocb = bdrv_aio_readv(s->bs, VAR_0->sector, &VAR_0->qiov, n,
scsi_read_complete, VAR_0); if (VAR_0->req.aiocb == NULL) { scsi_read_complete(VAR_0, -EIO); } }