pvscsi_convert_sglist(PVSCSIRequest *r)

{

    int chunk_size;

    uint64_t data_length = r->req.dataLen;

    PVSCSISGState sg = r->sg;

    while (data_length) {

        while (!sg.resid) {

            pvscsi_get_next_sg_elem(&sg);

            trace_pvscsi_convert_sglist(r->req.context, r->sg.dataAddr,

                                        r->sg.resid);

        }

        assert(data_length > 0);

        chunk_size = MIN((unsigned) data_length, sg.resid);

        if (chunk_size) {

            qemu_sglist_add(&r->sgl, sg.dataAddr, chunk_size);

        }



        sg.dataAddr += chunk_size;

        data_length -= chunk_size;

        sg.resid -= chunk_size;

    }

}

pvscsi_convert_sglist(PVSCSIRequest *r)

{

    int chunk_size;

    uint64_t data_length = r->req.dataLen;

    PVSCSISGState sg = r->sg;

    while (data_length) {

        while (!sg.resid) {

            pvscsi_get_next_sg_elem(&sg);

            trace_pvscsi_convert_sglist(r->req.context, r->sg.dataAddr,

                                        r->sg.resid);

        }

        assert(data_length > 0);

        chunk_size = MIN((unsigned) data_length, sg.resid);

        if (chunk_size) {

            qemu_sglist_add(&r->sgl, sg.dataAddr, chunk_size);

        }



        sg.dataAddr += chunk_size;

        data_length -= chunk_size;

        sg.resid -= chunk_size;

    }

}

FUNC_0(PVSCSIRequest *VAR_0)

{

    int VAR_1;

    uint64_t data_length = VAR_0->req.dataLen;

    PVSCSISGState sg = VAR_0->sg;

    while (data_length) {

        while (!sg.resid) {

            pvscsi_get_next_sg_elem(&sg);

            trace_pvscsi_convert_sglist(VAR_0->req.context, VAR_0->sg.dataAddr,

                                        VAR_0->sg.resid);

        }

        assert(data_length > 0);

        VAR_1 = MIN((unsigned) data_length, sg.resid);

        if (VAR_1) {

            qemu_sglist_add(&VAR_0->sgl, sg.dataAddr, VAR_1);

        }



        sg.dataAddr += VAR_1;

        data_length -= VAR_1;

        sg.resid -= VAR_1;

    }

}

FUNC_0(PVSCSIRequest *VAR_0)
{ int VAR_1; uint64_t data_length = VAR_0->req.dataLen; PVSCSISGState sg = VAR_0->sg; while (data_length) { while (!sg.resid) { pvscsi_get_next_sg_elem(&sg); trace_pvscsi_convert_sglist(VAR_0->req.context, VAR_0->sg.dataAddr,
VAR_0->sg.resid); } assert(data_length > 0); VAR_1 = MIN((unsigned) data_length, sg.resid); if (VAR_1) { qemu_sglist_add(&VAR_0->sgl, sg.dataAddr, VAR_1); } sg.dataAddr += VAR_1; data_length -= VAR_1; sg.resid -= VAR_1; } }