Skip to content
Snippets Groups Projects
  1. Aug 22, 2013
  2. Aug 19, 2013
    • Stefan Hajnoczi's avatar
      aio: drop io_flush argument · f2e5dca4
      Stefan Hajnoczi authored
      
      The .io_flush() handler no longer exists and has no users.  Drop the
      io_flush argument to aio_set_fd_handler() and related functions.
      
      The AioFlushEventNotifierHandler and AioFlushHandler typedefs are no
      longer used and are dropped too.
      
      Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      f2e5dca4
    • Stefan Hajnoczi's avatar
      aio: stop using .io_flush() · 164a101f
      Stefan Hajnoczi authored
      
      Now that aio_poll() users check their termination condition themselves,
      it is no longer necessary to call .io_flush() handlers.
      
      The behavior of aio_poll() changes as follows:
      
      1. .io_flush() is no longer invoked and file descriptors are *always*
      monitored.  Previously returning 0 from .io_flush() would skip this file
      descriptor.
      
      Due to this change it is essential to check that requests are pending
      before calling qemu_aio_wait().  Failure to do so means we block, for
      example, waiting for an idle iSCSI socket to become readable when there
      are no requests.  Currently all qemu_aio_wait()/aio_poll() callers check
      before calling.
      
      2. aio_poll() now returns true if progress was made (BH or fd handlers
      executed) and false otherwise.  Previously it would return true whenever
      'busy', which means that .io_flush() returned true.  The 'busy' concept
      no longer exists so just progress is returned.
      
      Due to this change we need to update tests/test-aio.c which asserts
      aio_poll() return values.  Note that QEMU doesn't actually rely on these
      return values so only tests/test-aio.c cares.
      
      Note that ctx->notifier, the EventNotifier fd used for aio_notify(), is
      now handled as a special case.  This is a little ugly but maintains
      aio_poll() semantics, i.e. aio_notify() does not count as 'progress' and
      aio_poll() avoids blocking when the user has not set any fd handlers yet.
      
      Patches after this remove .io_flush() handler code until we can finally
      drop the io_flush arguments to aio_set_fd_handler() and friends.
      
      Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      164a101f
  3. Jan 17, 2013
    • Kevin Wolf's avatar
      aio: Fix return value of aio_poll() · 2ea9b58f
      Kevin Wolf authored
      
      aio_poll() must return true if any work is still pending, even if it
      didn't make progress, so that bdrv_drain_all() doesn't stop waiting too
      early. The possibility of stopping early occasionally lead to a failed
      assertion in bdrv_drain_all(), when some in-flight request was missed
      and the function didn't really drain all requests.
      
      In order to make that change, the return value as specified in the
      function comment must change for blocking = false; fortunately, the
      return value of blocking = false callers is only used in test cases, so
      this change shouldn't cause any trouble.
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      2ea9b58f
  4. Dec 19, 2012
  5. Nov 26, 2012
  6. Oct 30, 2012
  7. Sep 28, 2012
  8. Apr 19, 2012
  9. Jan 13, 2012
  10. Aug 21, 2011
  11. May 21, 2010
  12. Oct 27, 2009
  13. Sep 12, 2009
    • Blue Swirl's avatar
      Fix sys-queue.h conflict for good · 72cf2d4f
      Blue Swirl authored
      
      Problem: Our file sys-queue.h is a copy of the BSD file, but there are
      some additions and it's not entirely compatible. Because of that, there have
      been conflicts with system headers on BSD systems. Some hacks have been
      introduced in the commits 15cc9235,
      f40d7537,
      96555a96 and
      3990d09a but the fixes were fragile.
      
      Solution: Avoid the conflict entirely by renaming the functions and the
      file. Revert the previous hacks.
      
      Signed-off-by: default avatarBlue Swirl <blauwirbel@gmail.com>
      72cf2d4f
  14. Jul 22, 2009
  15. Jun 15, 2009
  16. May 08, 2009
    • Alexander Graf's avatar
      AIO deletion race fix · 79d5ca56
      Alexander Graf authored
      
      When deleting an fd event there is a chance the object doesn't get
      deleted, but only ->deleted set positive and deleted somewhere later.
      
      Now, if we create a handler for the fd again before the actual
      deletion occurs, we end up writing data into an object that has
      ->deleted set, which is obviously wrong.
      
      I see two ways to fix this:
      
      1. Don't return ->deleted objects in the search
      2. Unset ->deleted in the search
      
      This patch implements 1. which feels safer to do. It fixes AIO issues
      I've seen with curl, as libcurl unsets fd event listeners pretty
      frequently.
      
      Signed-off-by: default avatarAlexander Graf <alex@csgraf.de>
      Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
      79d5ca56
  17. Feb 05, 2009
  18. Oct 12, 2008
  19. Sep 22, 2008
    • Anthony Liguori's avatar
      Refactor AIO to allow multiple AIO implementations · a76bab49
      Anthony Liguori authored
      
      This patch refactors the AIO layer to allow multiple AIO implementations.  It's
      only possible because of the recent signalfd() patch.  
      
      Right now, the AIO infrastructure is pretty specific to the block raw backend.
      For other block devices to implement AIO, the qemu_aio_wait function must
      support registration.  This patch introduces a new function,
      qemu_aio_set_fd_handler, which can be used to register a file descriptor to be
      called back.  qemu_aio_wait() now polls a set of file descriptors registered
      with this function until one becomes readable or writable.
      
      This patch should allow the implementation of alternative AIO backends (via a
      thread pool or linux-aio) and AIO backends in non-traditional block devices
      (like NBD).
      
      Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
      
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5297 c046a42c-6fe2-441c-8c8c-71466251a162
      a76bab49
Loading