qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] iscsi: partly avoid iovec linearization in iscs


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] iscsi: partly avoid iovec linearization in iscsi_aio_writev
Date: Mon, 19 Nov 2012 16:18:41 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121016 Thunderbird/16.0.1

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?

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]