From 3ee1483b95f314b960231c1c0b329bea4346f49c Mon Sep 17 00:00:00 2001 From: Vladimir Sementsov-Ogievskiy Date: Sun, 17 Jan 2021 00:46:51 +0300 Subject: job: call job_enter from job_pause 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: Vladimir Sementsov-Ogievskiy Message-Id: <20210116214705.822267-10-vsementsov@virtuozzo.com> Reviewed-by: Max Reitz Signed-off-by: Max Reitz --- job.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'job.c') diff --git a/job.c b/job.c index 8fecf38960..3aaaebafe2 100644 --- a/job.c +++ b/job.c @@ -553,6 +553,9 @@ static bool job_timer_not_pending(Job *job) void job_pause(Job *job) { job->pause_count++; + if (!job->paused) { + job_enter(job); + } } void job_resume(Job *job) -- cgit 1.4.1