Re: [Qemu-devel] [PATCH 05/10] dma-helpers: add dma_buf_read and dma_buf_write

2011-08-11 Thread Stefan Hajnoczi
On Thu, Aug 11, 2011 at 4:27 PM, Paolo Bonzini wrote: > On 08/11/2011 05:12 PM, Kevin Wolf wrote: >>> >>> >  Another possibility is always completing DMA in a bottom half.  This >>> >  ensures that the callback can access the AIOCB, but it exposes an >>> >  implementation detail to the caller, so

Re: [Qemu-devel] [PATCH 05/10] dma-helpers: add dma_buf_read and dma_buf_write

2011-08-11 Thread Paolo Bonzini
On 08/11/2011 05:12 PM, Kevin Wolf wrote: > Another possibility is always completing DMA in a bottom half. This > ensures that the callback can access the AIOCB, but it exposes an > implementation detail to the caller, so I don't like it. At least in the block layer, AIO callbacks may never

Re: [Qemu-devel] [PATCH 05/10] dma-helpers: add dma_buf_read and dma_buf_write

2011-08-11 Thread Kevin Wolf
Am 11.08.2011 17:05, schrieb Paolo Bonzini: > On 08/11/2011 04:37 PM, Kevin Wolf wrote: >>> Right, I would rather update BlockDriverCompletionFunc to pass the AIOCB >>> as a third parameter, and store the residual bytes in the DMAAIOCB (with >>> a getter that the completion function can use). >>

Re: [Qemu-devel] [PATCH 05/10] dma-helpers: add dma_buf_read and dma_buf_write

2011-08-11 Thread Paolo Bonzini
On 08/11/2011 04:37 PM, Kevin Wolf wrote: > Right, I would rather update BlockDriverCompletionFunc to pass the AIOCB > as a third parameter, and store the residual bytes in the DMAAIOCB (with > a getter that the completion function can use). Isn't the DMAAIOCB already passed as opaque to the

Re: [Qemu-devel] [PATCH 05/10] dma-helpers: add dma_buf_read and dma_buf_write

2011-08-11 Thread Kevin Wolf
Am 11.08.2011 16:24, schrieb Paolo Bonzini: > On 08/11/2011 03:29 PM, Stefan Hajnoczi wrote: What do you think about passing the residual bytes for short transfers? Should I look into updating BlockDriverCompletionFunc, or is the approach of patch 2 okay? If I have a

Re: [Qemu-devel] [PATCH 05/10] dma-helpers: add dma_buf_read and dma_buf_write

2011-08-11 Thread Paolo Bonzini
On 08/11/2011 03:29 PM, Stefan Hajnoczi wrote: > > What do you think about passing the residual bytes for short transfers? >Should I look into updating BlockDriverCompletionFunc, or is the approach > of patch 2 okay? If I have an excuse to learn more about Coccinelle, that > can be fun.:)

Re: [Qemu-devel] [PATCH 05/10] dma-helpers: add dma_buf_read and dma_buf_write

2011-08-11 Thread Stefan Hajnoczi
On Thu, Aug 11, 2011 at 1:10 PM, Paolo Bonzini wrote: > On 08/11/2011 09:58 AM, Stefan Hajnoczi wrote: >> >> On Thu, Aug 04, 2011 at 07:14:43PM +0200, Paolo Bonzini wrote: >>> >>> These helpers do a full transfer from an in-memory buffer to >>> target memory, with full support for MMIO areas.  It

Re: [Qemu-devel] [PATCH 05/10] dma-helpers: add dma_buf_read and dma_buf_write

2011-08-11 Thread Paolo Bonzini
On 08/11/2011 09:58 AM, Stefan Hajnoczi wrote: On Thu, Aug 04, 2011 at 07:14:43PM +0200, Paolo Bonzini wrote: These helpers do a full transfer from an in-memory buffer to target memory, with full support for MMIO areas. It will be used to store the reply of an emulated command into a QEMUSGList

Re: [Qemu-devel] [PATCH 05/10] dma-helpers: add dma_buf_read and dma_buf_write

2011-08-11 Thread Stefan Hajnoczi
On Thu, Aug 04, 2011 at 07:14:43PM +0200, Paolo Bonzini wrote: > These helpers do a full transfer from an in-memory buffer to > target memory, with full support for MMIO areas. It will be used to store > the reply of an emulated command into a QEMUSGList provided by the > adapter. > > Signed-off-

[Qemu-devel] [PATCH 05/10] dma-helpers: add dma_buf_read and dma_buf_write

2011-08-04 Thread Paolo Bonzini
These helpers do a full transfer from an in-memory buffer to target memory, with full support for MMIO areas. It will be used to store the reply of an emulated command into a QEMUSGList provided by the adapter. Signed-off-by: Paolo Bonzini --- cutils.c |8 +++--- dma-helpers.c | 63 +