job: Add job_yield()

This moves block_job_yield() to the Job layer.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
Kevin Wolf 2018-04-24 16:55:04 +02:00
parent b3b5299d58
commit 198c49cc8d
7 changed files with 28 additions and 31 deletions

View file

@ -107,14 +107,6 @@ void block_job_user_resume(Job *job);
*/
void block_job_drain(Job *job);
/**
* block_job_yield:
* @job: The job that calls the function.
*
* Yield the block job coroutine.
*/
void block_job_yield(BlockJob *job);
/**
* block_job_ratelimit_get_delay:
*

View file

@ -337,6 +337,13 @@ void job_enter(Job *job);
*/
void coroutine_fn job_pause_point(Job *job);
/**
* @job: The job that calls the function.
*
* Yield the job coroutine.
*/
void job_yield(Job *job);
/**
* @job: The job that calls the function.
* @ns: How many nanoseconds to stop for.
@ -508,8 +515,6 @@ int job_finish_sync(Job *job, void (*finish)(Job *, Error **errp), Error **errp)
/* TODO To be removed from the public interface */
void job_state_transition(Job *job, JobStatus s1);
void coroutine_fn job_do_yield(Job *job, uint64_t ns);
bool job_should_pause(Job *job);
void job_do_dismiss(Job *job);
#endif