Am 19.11.2012 um 16:18 schrieb Paolo Bonzini <pbonz...@redhat.com>: > Il 19/11/2012 15:58, Peter Lieven ha scritto: >> >> - /* XXX we should pass the iovec to write16 to avoid the extra copy */ >> - /* this will allow us to get rid of 'buf' completely */ >> size = nb_sectors * BDRV_SECTOR_SIZE; >> - acb->buf = g_malloc(size); >> - qemu_iovec_to_buf(acb->qiov, 0, acb->buf, size); >> + data.size = size; >> + >> + /* if the iovec only contains one buffer we can pass it directly */ >> + if (acb->qiov->niov == 1) { >> + acb->buf = NULL; >> + data.data = acb->qiov->iov[0].iov_base; >> + } else { >> + acb->buf = g_malloc(size); >> + qemu_iovec_to_buf(acb->qiov, 0, acb->buf, size); >> + data.data = acb->buf; >> + } > > Looks good, but how hard is it to get rid of the bounce buffer > completely, as mentioned in the comment? Ronnie?
afaik, he is working on that. but therefore it needs support for passing buffers to libiscsi also for write operations (currently thats only possible for reads). this was just an easy catch and can be reverted once libiscsi has support for this. we are working on some abi changes which separate libiscsi for the scsi-lowlevel operations. we have to make modifications to the qemu driver then as well, maybe this could be done at the same point. Peter > > Paolo