mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
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:
parent
b3b5299d58
commit
198c49cc8d
7 changed files with 28 additions and 31 deletions
16
blockjob.c
16
blockjob.c
|
@ -431,22 +431,6 @@ void *block_job_create(const char *job_id, const BlockJobDriver *driver,
|
|||
return job;
|
||||
}
|
||||
|
||||
void block_job_yield(BlockJob *job)
|
||||
{
|
||||
assert(job->job.busy);
|
||||
|
||||
/* Check cancellation *before* setting busy = false, too! */
|
||||
if (job_is_cancelled(&job->job)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!job_should_pause(&job->job)) {
|
||||
job_do_yield(&job->job, -1);
|
||||
}
|
||||
|
||||
job_pause_point(&job->job);
|
||||
}
|
||||
|
||||
void block_job_iostatus_reset(BlockJob *job)
|
||||
{
|
||||
if (job->iostatus == BLOCK_DEVICE_IO_STATUS_OK) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue