mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
job: Move pause/resume functions to Job
While we already moved the state related to job pausing to Job, the functions to do were still BlockJob only. This commit moves them over to Job. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
This commit is contained in:
parent
5d43e86e11
commit
b15de82867
13 changed files with 133 additions and 102 deletions
|
@ -56,12 +56,6 @@ typedef struct BlockJob {
|
|||
*/
|
||||
bool force;
|
||||
|
||||
/**
|
||||
* Set to true if the job is paused by user. Can be unpaused with the
|
||||
* block-job-resume QMP command.
|
||||
*/
|
||||
bool user_paused;
|
||||
|
||||
/**
|
||||
* Set to true when the job is ready to be completed.
|
||||
*/
|
||||
|
@ -247,32 +241,6 @@ void block_job_progress_set_remaining(BlockJob *job, uint64_t remaining);
|
|||
*/
|
||||
BlockJobInfo *block_job_query(BlockJob *job, Error **errp);
|
||||
|
||||
/**
|
||||
* block_job_user_pause:
|
||||
* @job: The job to be paused.
|
||||
*
|
||||
* Asynchronously pause the specified job.
|
||||
* Do not allow a resume until a matching call to block_job_user_resume.
|
||||
*/
|
||||
void block_job_user_pause(BlockJob *job, Error **errp);
|
||||
|
||||
/**
|
||||
* block_job_paused:
|
||||
* @job: The job to query.
|
||||
*
|
||||
* Returns true if the job is user-paused.
|
||||
*/
|
||||
bool block_job_user_paused(BlockJob *job);
|
||||
|
||||
/**
|
||||
* block_job_user_resume:
|
||||
* @job: The job to be resumed.
|
||||
*
|
||||
* Resume the specified job.
|
||||
* Must be paired with a preceding block_job_user_pause.
|
||||
*/
|
||||
void block_job_user_resume(BlockJob *job, Error **errp);
|
||||
|
||||
/**
|
||||
* block_job_user_cancel:
|
||||
* @job: The job to be cancelled.
|
||||
|
|
|
@ -133,6 +133,13 @@ void *block_job_create(const char *job_id, const BlockJobDriver *driver,
|
|||
*/
|
||||
void block_job_free(Job *job);
|
||||
|
||||
/**
|
||||
* block_job_user_resume:
|
||||
* Callback to be used for JobDriver.user_resume in all block jobs. Resets the
|
||||
* iostatus when the user resumes @job.
|
||||
*/
|
||||
void block_job_user_resume(Job *job);
|
||||
|
||||
/**
|
||||
* block_job_yield:
|
||||
* @job: The job that calls the function.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue