1. 13 7月, 2016 1 次提交
  2. 05 2月, 2016 1 次提交
    • P
      util: Clean up includes · aafd7584
      Peter Maydell 提交于
      Clean up includes so that osdep.h is included first and headers
      which it implies are not included manually.
      
      This commit was created with scripts/clean-includes.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1454089805-5470-6-git-send-email-peter.maydell@linaro.org
      aafd7584
  3. 20 10月, 2015 1 次提交
    • D
      coroutine: move into libqemuutil.a library · 10817bf0
      Daniel P. Berrange 提交于
      The coroutine files are currently referenced by the block-obj-y
      variable. The coroutine functionality though is already used by
      more than just the block code. eg migration code uses coroutine
      yield. In the future the I/O channel code will also use the
      coroutine yield functionality. Since the coroutine code is nicely
      self-contained it can be easily built as part of the libqemuutil.a
      library, making it widely available.
      
      The headers are also moved into include/qemu, instead of the
      include/block directory, since they are now part of the util
      codebase, and the impl was never in the block/ directory
      either.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      10817bf0
  4. 30 4月, 2015 1 次提交
  5. 03 12月, 2013 1 次提交
  6. 29 7月, 2013 1 次提交
  7. 24 5月, 2013 1 次提交
    • S
      coroutine: stop using AioContext in CoQueue · 02ffb504
      Stefan Hajnoczi 提交于
      qemu_co_queue_next(&queue) arranges that the next queued coroutine is
      run at a later point in time.  This deferred restart is useful because
      the caller may not want to transfer control yet.
      
      This behavior was implemented using QEMUBH in the past, which meant that
      CoQueue (and hence CoMutex and CoRwlock) had a dependency on the
      AioContext event loop.  This hidden dependency causes trouble when we
      move to a world with multiple event loops - now qemu_co_queue_next()
      needs to know which event loop to schedule the QEMUBH in.
      
      After pondering how to stash AioContext I realized the best solution is
      to not use AioContext at all.  This patch implements the deferred
      restart behavior purely in terms of coroutines and no longer uses
      QEMUBH.
      
      Here is how it works:
      
      Each Coroutine has a wakeup queue that starts out empty.  When
      qemu_co_queue_next() is called, the next coroutine is added to our
      wakeup queue.  The wakeup queue is processed when we yield or terminate.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      02ffb504
  8. 15 3月, 2013 1 次提交
    • S
      coroutine: use AioContext for CoQueue BH · 28f08246
      Stefan Hajnoczi 提交于
      CoQueue uses a BH to awake coroutines that were made ready to run again
      using qemu_co_queue_next() or qemu_co_queue_restart_all().  The BH
      currently runs in the iothread AioContext and would break coroutines
      that run in a different AioContext.
      
      This is a slightly tricky problem because the lifetime of the BH exceeds
      that of the CoQueue.  This means coroutines can be awoken after CoQueue
      itself has been freed.  Also, there is no qemu_co_queue_destroy()
      function which we could use to handle freeing resources.
      
      Introducing qemu_co_queue_destroy() has a ripple effect of requiring us
      to also add qemu_co_mutex_destroy() and qemu_co_rwlock_destroy(), as
      well as updating all callers.  Avoid doing that.
      
      We also cannot switch from BH to GIdle function because aio_poll() does
      not dispatch GIdle functions.  (GIdle functions make memory management
      slightly easier because they free themselves.)
      
      Finally, I don't want to move unlock_queue and unlock_bh into
      AioContext.  That would break encapsulation - AioContext isn't supposed
      to know about CoQueue.
      
      This patch implements a different solution: each qemu_co_queue_next() or
      qemu_co_queue_restart_all() call creates a new BH and list of coroutines
      to wake up.  Callers tend to invoke qemu_co_queue_next() and
      qemu_co_queue_restart_all() occasionally after blocking I/O, so creating
      a new BH for each call shouldn't be massively inefficient.
      
      Note that this patch does not add an interface for specifying the
      AioContext.  That is left to future patches which will convert CoQueue,
      CoMutex, and CoRwlock to expose AioContext.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      28f08246
  9. 19 12月, 2012 2 次提交
  10. 30 10月, 2012 1 次提交
    • P
      aio: introduce AioContext, move bottom halves there · f627aab1
      Paolo Bonzini 提交于
      Start introducing AioContext, which will let us remove globals from
      aio.c/async.c, and introduce multiple I/O threads.
      
      The bottom half functions now take an additional AioContext argument.
      A bottom half is created with a specific AioContext that remains the
      same throughout the lifetime.  qemu_bh_new is just a wrapper that
      uses a global context.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      f627aab1
  11. 05 12月, 2011 2 次提交
  12. 22 10月, 2011 1 次提交
  13. 23 8月, 2011 1 次提交
  14. 02 8月, 2011 2 次提交