Skip to content
Snippets Groups Projects
  • Vladimir Sementsov-Ogievskiy's avatar
    3ee1483b
    job: call job_enter from job_pause · 3ee1483b
    Vladimir Sementsov-Ogievskiy authored
    
    If main job coroutine called job_yield (while some background process
    is in progress), we should give it a chance to call job_pause_point().
    It will be used in backup, when moved on async block-copy.
    
    Note, that job_user_pause is not enough: we want to handle
    child_job_drained_begin() as well, which call job_pause().
    
    Still, if job is already in job_do_yield() in job_pause_point() we
    should not enter it.
    
    iotest 109 output is modified: on stop we do bdrv_drain_all() which now
    triggers job pause immediately (and pause after ready is standby).
    
    Signed-off-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Message-Id: <20210116214705.822267-10-vsementsov@virtuozzo.com>
    Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
    Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
    3ee1483b
    History
    job: call job_enter from job_pause
    Vladimir Sementsov-Ogievskiy authored
    
    If main job coroutine called job_yield (while some background process
    is in progress), we should give it a chance to call job_pause_point().
    It will be used in backup, when moved on async block-copy.
    
    Note, that job_user_pause is not enough: we want to handle
    child_job_drained_begin() as well, which call job_pause().
    
    Still, if job is already in job_do_yield() in job_pause_point() we
    should not enter it.
    
    iotest 109 output is modified: on stop we do bdrv_drain_all() which now
    triggers job pause immediately (and pause after ready is standby).
    
    Signed-off-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Message-Id: <20210116214705.822267-10-vsementsov@virtuozzo.com>
    Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
    Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
job.c 24.66 KiB