[Top][All Lists]
[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.
- [Qemu-devel] [PATCH 0/5] Direct memory access for devices, Avi Kivity, 2009/01/18
- [Qemu-devel] [PATCH 4/5] I/O vector helpers, Avi Kivity, 2009/01/18
- [Qemu-devel] [PATCH 5/5] Convert IDE to directly access guest memory, Avi Kivity, 2009/01/18
- [Qemu-devel] [PATCH 3/5] Vectored block device API, Avi Kivity, 2009/01/18
- Re: [Qemu-devel] [PATCH 3/5] Vectored block device API,
Blue Swirl <=
- [Qemu-devel] [PATCH 1/5] Add target memory mapping API, Avi Kivity, 2009/01/18
- Re: [Qemu-devel] [PATCH 1/5] Add target memory mapping API, Ian Jackson, 2009/01/19
- Re: [Qemu-devel] [PATCH 1/5] Add target memory mapping API, Avi Kivity, 2009/01/19
- Re: [Qemu-devel] [PATCH 1/5] Add target memory mapping API, Anthony Liguori, 2009/01/19
- Re: [Qemu-devel] [PATCH 1/5] Add target memory mapping API, Paul Brook, 2009/01/19
- Re: [Qemu-devel] [PATCH 1/5] Add target memory mapping API, Anthony Liguori, 2009/01/19
- Re: [Qemu-devel] [PATCH 1/5] Add target memory mapping API, Avi Kivity, 2009/01/19
- Re: [Qemu-devel] [PATCH 1/5] Add target memory mapping API, Anthony Liguori, 2009/01/19
- Re: [Qemu-devel] [PATCH 1/5] Add target memory mapping API, Avi Kivity, 2009/01/20