1. 01 3月, 2017 1 次提交
  2. 15 11月, 2016 1 次提交
    • J
      blockjob: add block_job_start · 5ccac6f1
      John Snow 提交于
      Instead of automatically starting jobs at creation time via backup_start
      et al, we'd like to return a job object pointer that can be started
      manually at later point in time.
      
      For now, add the block_job_start mechanism and start the jobs
      automatically as we have been doing, with conversions job-by-job coming
      in later patches.
      
      Of note: cancellation of unstarted jobs will perform all the normal
      cleanup as if the job had started, particularly abort and clean. The
      only difference is that we will not emit any events, because the job
      never actually started.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 1478587839-9834-5-git-send-email-jsnow@redhat.com
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      5ccac6f1
  3. 01 11月, 2016 5 次提交
  4. 31 10月, 2016 1 次提交
  5. 28 10月, 2016 1 次提交
  6. 13 7月, 2016 3 次提交
  7. 12 7月, 2016 1 次提交
  8. 20 6月, 2016 3 次提交
    • S
      blockjob: add AioContext attached callback · 463e0be1
      Stefan Hajnoczi 提交于
      Block jobs that use additional BDSes or event loop resources need a
      callback to get their affairs in order when the AioContext is switched.
      
      Simple block jobs don't need an attach callback, they automatically work
      thanks to the generic attach/detach notifiers that this patch adds.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Message-id: 1466096189-6477-7-git-send-email-stefanha@redhat.com
      463e0be1
    • S
      blockjob: add pause points · fc9c0a9c
      Stefan Hajnoczi 提交于
      Block jobs are coroutines that usually perform I/O but sometimes also
      sleep or yield.  Currently only sleeping or yielded block jobs can be
      paused.  This means jobs that do not sleep or yield (using
      block_job_yield()) are unaffected by block_job_pause().
      
      Add block_job_pause_point() so that block jobs can mark quiescent points
      that are suitable for pausing.  This solves the problem that it can take
      a block job a long time to pause if it is performing a long series of
      I/O operations.
      
      Transitioning to paused state involves a .pause()/.resume() callback.
      These callbacks are used to ensure that I/O and event loop activity has
      ceased while the job is at a pause point.
      
      Note that this patch introduces a stricter pause state than previously.
      The job->busy flag was incorrectly documented as a quiescent state
      without I/O pending.  This is violated by any job that has I/O pending
      across sleep or block_job_yield(), like the mirror block job.
      
      [Add missing block_job_should_pause() check to avoid deadlock after
      job->driver->pause() in block_job_pause_point().
      --Stefan]
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Message-id: 1466096189-6477-4-git-send-email-stefanha@redhat.com
      fc9c0a9c
    • S
      blockjob: rename block_job_is_paused() · a7f3b7ff
      Stefan Hajnoczi 提交于
      The block_job_is_paused() function name is not great because callers
      only use it to determine whether pausing has been requested.  Rename it
      to highlight those semantics and remove it from the public header file
      as there are no external callers.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Message-id: 1466096189-6477-3-git-send-email-stefanha@redhat.com
      a7f3b7ff
  9. 07 6月, 2016 1 次提交
  10. 26 5月, 2016 4 次提交
  11. 19 5月, 2016 1 次提交
    • K
      blockjob: Don't set iostatus of target · 81e254dc
      Kevin Wolf 提交于
      When block job errors were introduced, we assigned the iostatus of the
      target BDS "just in case". The field has never been accessible for the
      user because the target isn't listed in query-block.
      
      Before we can allow the user to have a second BlockBackend on the
      target, we need to clean this up. If anything, we would want to set the
      iostatus for the internal BB of the job (which we can always do later),
      but certainly not for a separate BB which the job doesn't even use.
      
      As a nice side effect, this gets us rid of another bs->blk use.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      81e254dc
  12. 09 2月, 2016 1 次提交
    • F
      blockjob: Fix hang in block_job_finish_sync · 794f0141
      Fam Zheng 提交于
      With a mirror job running on a virtio-blk dataplane disk, sending "q" to
      HMP will cause a dead loop in block_job_finish_sync.
      
      This is because the aio_poll() only processes the AIO context of bs
      which has no more work to do, while the main loop BH that is scheduled
      for setting the job->completed flag is never processed.
      
      Fix this by adding a flag in BlockJob structure, to track which context
      to poll for the block job to make progress. Its value is set to true
      when block_job_coroutine_complete() is called, and is checked in
      block_job_finish_sync to determine which context to poll.
      Suggested-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Message-id: 1454379144-29807-1-git-send-email-famz@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      794f0141
  13. 12 11月, 2015 4 次提交
  14. 16 10月, 2015 1 次提交
  15. 07 7月, 2015 1 次提交
  16. 28 4月, 2015 1 次提交
    • F
      blockjob: Allow nested pause · 751ebd76
      Fam Zheng 提交于
      This patch changes block_job_pause to increase the pause counter and
      block_job_resume to decrease it.
      
      The counter will allow calling block_job_pause/block_job_resume
      unconditionally on a job when we need to suspend the IO temporarily.
      
      From now on, each block_job_resume must be paired with a block_job_pause
      to keep the counter balanced.
      
      The user pause from QMP or HMP will only trigger block_job_pause once
      until it's resumed, this is achieved by adding a user_paused flag in
      BlockJob.
      
      One occurrence of block_job_resume in mirror_complete is replaced with
      block_job_enter which does what is necessary.
      
      In block_job_cancel, the cancel flag is good enough to instruct
      coroutines to quit loop, so use block_job_enter to replace the unpaired
      block_job_resume.
      
      Upon block job IO error, user is notified about the entering to the
      pause state, so this pause belongs to user pause, set the flag
      accordingly and expect a matching QMP resume.
      
      [Extended doc comments as suggested by Paolo Bonzini
      <pbonzini@redhat.com>.
      --Stefan]
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NAlberto Garcia <berto@igalia.com>
      Message-id: 1428069921-2957-2-git-send-email-famz@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      751ebd76
  17. 03 11月, 2014 3 次提交
  18. 20 10月, 2014 1 次提交
  19. 09 7月, 2014 1 次提交
  20. 27 6月, 2014 1 次提交
  21. 26 6月, 2014 1 次提交
  22. 23 6月, 2014 1 次提交
  23. 28 5月, 2014 1 次提交
    • F
      block: Replace in_use with operation blocker · 3718d8ab
      Fam Zheng 提交于
      This drops BlockDriverState.in_use with op_blockers:
      
        - Call bdrv_op_block_all in place of bdrv_set_in_use(bs, 1).
      
        - Call bdrv_op_unblock_all in place of bdrv_set_in_use(bs, 0).
      
        - Check bdrv_op_is_blocked() in place of bdrv_in_use(bs).
      
          The specific types are used, e.g. in place of starting block backup,
          bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_BACKUP, ...).
      
          There is one exception in block_job_create, where
          bdrv_op_blocker_is_empty() is used, because we don't know the operation
          type here. This doesn't matter because in a few commits away we will drop
          the check and move it to callers that _do_ know the type.
      
        - Check bdrv_op_blocker_is_empty() in place of assert(!bs->in_use).
      
      Note: there is only bdrv_op_block_all and bdrv_op_unblock_all callers at
      this moment. So although the checks are specific to op types, this
      changes can still be seen as identical logic with previously with
      in_use. The difference is error message are improved because of blocker
      error info.
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      3718d8ab
  24. 11 10月, 2013 1 次提交