On 26/04/2017 22:25, John Snow wrote: >> >> void block_job_iostatus_reset(BlockJob *job) >> { >> + if (job->iostatus == BLOCK_DEVICE_IO_STATUS_OK) { >> + return; >> + } >> + assert(job->user_paused && job->pause_count > 0); > Why assert that it's user-paused? Will that be true from: > > (A) All users of block_job_cancel_async, including: > > - block_job_cancel > - block_job_completed > block_job_completed_txn_abort > > (B) all users of blk_iostatus_reset: > - blk_do_attach_dev > - qmp_cont > > It's ... not really clear to me that this is true, can you help me out?
Setting iostatus to not-ok only happens in block_job_iostatus_set_err, which is called from block_job_error_action: if (action == BLOCK_ERROR_ACTION_STOP) { /* make the pause user visible, which will be resumed from QMP. */ block_job_user_pause(job); block_job_iostatus_set_err(job, error); } Paolo Paolo