qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 3/5] Vectored block device API


From: Blue Swirl
Subject: Re: [Qemu-devel] [PATCH 3/5] Vectored block device API
Date: Mon, 19 Jan 2009 18:54:45 +0200

On 1/18/09, Avi Kivity <address@hidden> wrote:
> Most devices that are capable of DMA are also capable of scatter-gather.
>  With the memory mapping API, this means that the device code needs to be
>  able to access discontiguous host memory regions.
>
>  For block devices, this translates to vectored I/O.  This patch implements
>  an aynchronous vectored interface for the qemu block devices.  At the moment
>  all I/O is bounced and submitted through the non-vectored API; in the future
>  we will convert block devices to natively support vectored I/O wherever
>  possible.
>
>  Signed-off-by: Avi Kivity <address@hidden>

>  +static void flatten_iovec(VectorTranslationState *s)
>  +{
>  +    uint8_t *p = s->bounce;
>  +    int i;
>  +
>  +    for (i = 0; i < s->niov; ++i) {
>  +        memcpy(p, s->iov[i].iov_base, s->iov[i].iov_len);
>  +        p += s->iov[i].iov_len;
>  +    }
>  +}
>  +
>  +static void unflatten_iovec(VectorTranslationState *s)
>  +{
>  +    uint8_t *p = s->bounce;
>  +    int i;
>  +
>  +    for (i = 0; i < s->niov; ++i) {
>  +        memcpy(s->iov[i].iov_base, p, s->iov[i].iov_len);
>  +        p += s->iov[i].iov_len;
>  +    }
>  +}

I think these should be moved to vl.c together with patch 4 stuff,
they are not block device specific.




reply via email to

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