1. 06 Jan, 2014 1 commit
  2. 16 Dec, 2013 2 commits
  3. 12 Sep, 2013 1 commit
  4. 19 Aug, 2013 2 commits
  5. 18 Jun, 2013 1 commit
  6. 12 May, 2013 1 commit
  7. 22 Apr, 2013 1 commit
  8. 15 Apr, 2013 3 commits
  9. 02 Apr, 2013 1 commit
  10. 22 Mar, 2013 6 commits
  11. 19 Dec, 2012 2 commits
  12. 12 Nov, 2012 2 commits
  13. 11 Jun, 2012 1 commit
    • Michael Tokarev's avatar
      cleanup qemu_co_sendv(), qemu_co_recvv() and friends · 2fc8ae1d
      Michael Tokarev authored
      The same as for non-coroutine versions in previous
      patches: rename arguments to be more obvious, change
      type of arguments from int to size_t where appropriate,
      and use common code for send and receive paths (with
      one extra argument) since these are exactly the same.
      Use common iov_send_recv() directly.
      
      qemu_co_sendv(), qemu_co_recvv(), and qemu_co_recv()
      are now trivial #define's merely adding one extra arg.
      
      qemu_co_sendv() and qemu_co_recvv() callers are
      converted to different argument order and extra
      `iov_cnt' argument.
      Signed-off-by: default avatarMichael Tokarev <mjt@tls.msk.ru>
      2fc8ae1d
  14. 26 Apr, 2012 1 commit
  15. 19 Apr, 2012 5 commits
  16. 22 Dec, 2011 6 commits
  17. 06 Dec, 2011 1 commit
  18. 21 Oct, 2011 3 commits
    • Paolo Bonzini's avatar
      block: take lock around bdrv_write implementations · e183ef75
      Paolo Bonzini authored
      This does the first part of the conversion to coroutines, by
      wrapping bdrv_write implementations to take the mutex.
      
      Drivers that implement bdrv_write rather than bdrv_co_writev can
      then benefit from asynchronous operation (at least if the underlying
      protocol supports it, which is not the case for raw-win32), even
      though they still operate with a bounce buffer.
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      e183ef75
    • Paolo Bonzini's avatar
      block: take lock around bdrv_read implementations · 2914caa0
      Paolo Bonzini authored
      This does the first part of the conversion to coroutines, by
      wrapping bdrv_read implementations to take the mutex.
      
      Drivers that implement bdrv_read rather than bdrv_co_readv can
      then benefit from asynchronous operation (at least if the underlying
      protocol supports it, which is not the case for raw-win32), even
      though they still operate with a bounce buffer.
      
      raw-win32 does not need the lock, because it cannot yield.
      nbd also doesn't probably, but better be safe.
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      2914caa0
    • Paolo Bonzini's avatar
      block: add a CoMutex to synchronous read drivers · 848c66e8
      Paolo Bonzini authored
      The big conversion of bdrv_read/write to coroutines caused the two
      homonymous callbacks in BlockDriver to become reentrant.  It goes
      like this:
      
      1) bdrv_read is now called in a coroutine, and calls bdrv_read or
      bdrv_pread.
      
      2) the nested bdrv_read goes through the fast path in bdrv_rw_co_entry;
      
      3) in the common case when the protocol is file, bdrv_co_do_readv calls
      bdrv_co_readv_em (and from here goes to bdrv_co_io_em), which yields
      until the AIO operation is complete;
      
      4) if bdrv_read had been called from a bottom half, the main loop
      is free to iterate again: a device model or another bottom half
      can then come and call bdrv_read again.
      
      This applies to all four of read/write/flush/discard.  It would also
      apply to is_allocated, but it is not used from within coroutines:
      besides qemu-img.c and qemu-io.c, which operate synchronously, the
      only user is the monitor.  Copy-on-read will introduce a use in the
      block layer, and will require converting it.
      
      The solution is "simply" to convert all drivers to coroutines!  We
      just need to add a CoMutex that is taken around affected operations.
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      848c66e8