« Previous | Next » 

Revision c3adb5b9


Added by Paolo Bonzini over 8 years ago

dma-helpers: rewrite completion/cancellation

This fixes various problems with completion/cancellation:

  • if the io_func fails to get an AIOCB, the callback wasn't called
  • If DMA encounters a bounce buffer conflict, and the DMA operation is
    canceled before the bottom half fires, bad things happen.
  • memory is not unmapped after cancellation, again causing problems
    when doing DMA to I/O areas
  • cancellation could leak the iovec
  • the callback was missed if the I/O operation failed without returning
    an AIOCB

and probably more that I've missed. The patch fixes them by sharing
the cleanup code between completion and cancellation. The dma_bdrv_cb
now returns a boolean completed/not completed flag, and the wrapper
dma_continue takes care of tasks to do upon completion.

Most of these are basically impossible in practice, but it is better
to be tidy...

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>


  • added
  • modified
  • copied
  • renamed
  • deleted

View differences